annotate src/tft.asm @ 625:5c2ca77ce2df

doc update (Byte 59)
author heinrichsweikamp
date Sun, 23 Jun 2019 13:29:17 +0200
parents d866684249bd
children c40025d8e750
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
3 ; File tft.asm ## V2.99c
0
heinrichsweikamp
parents:
diff changeset
4 ;
heinrichsweikamp
parents:
diff changeset
5 ; Managing the TFT screen
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 "external_flash.inc"
heinrichsweikamp
parents:
diff changeset
16 #include "tft_outputs.inc"
heinrichsweikamp
parents:
diff changeset
17 #include "eeprom_rs232.inc"
heinrichsweikamp
parents:
diff changeset
18
heinrichsweikamp
parents:
diff changeset
19 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
20 ; Basic bit-level macros
heinrichsweikamp
parents:
diff changeset
21
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
22 RD_H macro
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
23 bsf tft_rd,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
24 endm
0
heinrichsweikamp
parents:
diff changeset
25
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
26 RD_L macro
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
27 bcf tft_rd,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
28 endm
0
heinrichsweikamp
parents:
diff changeset
29
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
30 RS_H macro
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
31 bsf tft_rs,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
32 endm
0
heinrichsweikamp
parents:
diff changeset
33
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
34 RS_L macro
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
35 bcf tft_rs,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
36 endm
0
heinrichsweikamp
parents:
diff changeset
37
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
38 NCS_H macro
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
39 bsf tft_cs,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
40 endm
0
heinrichsweikamp
parents:
diff changeset
41
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
42 NCS_L macro
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
43 bcf tft_cs,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
44 endm
0
heinrichsweikamp
parents:
diff changeset
45
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
46 WR_H macro
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
47 bsf tft_nwr,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
48 endm
0
heinrichsweikamp
parents:
diff changeset
49
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
50 WR_L macro
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
51 bcf tft_nwr,0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
52 endm
0
heinrichsweikamp
parents:
diff changeset
53
heinrichsweikamp
parents:
diff changeset
54 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
55 ; Byte-level macros
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
56
0
heinrichsweikamp
parents:
diff changeset
57 Index_out macro low_b
heinrichsweikamp
parents:
diff changeset
58 movlw low_b
heinrichsweikamp
parents:
diff changeset
59 rcall TFT_CmdWrite
heinrichsweikamp
parents:
diff changeset
60 endm
heinrichsweikamp
parents:
diff changeset
61
heinrichsweikamp
parents:
diff changeset
62 Parameter_out macro high_b, low_b
heinrichsweikamp
parents:
diff changeset
63 movlw high_b
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
64 movwf PORTA ; upper
0
heinrichsweikamp
parents:
diff changeset
65 movlw low_b
heinrichsweikamp
parents:
diff changeset
66 rcall TFT_DataWrite
heinrichsweikamp
parents:
diff changeset
67 endm
heinrichsweikamp
parents:
diff changeset
68
heinrichsweikamp
parents:
diff changeset
69
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
70 tft CODE
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
71
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
72 ;;=============================================================================
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
73 ;; TFT_write_flash_image
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
74 ;;
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
75 ;; Inputs: FSR2 = EEPROM address / 256
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
76 ;; win_left, win_top : image CENTER position
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
77 ;; Outputs: win_height, win_width.
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
78 ;; image copied on screen.
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
79 ;; Trashed: PROD, hi, lo
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
80 ;;
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
81 ; global TFT_write_flash_image
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
82 ;TFT_write_flash_image:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
83 ; ; Get back the full 24bit EEPROM address
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
84 ; clrf ext_flash_address+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
85 ; movff FSR2L,ext_flash_address+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
86 ; movf FSR2H,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
87 ; iorlw 0x30
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
88 ; movwf ext_flash_address+2
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
89 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
90 ; ; Read header: width and height
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
91 ; global TFT_write_flash_image_addr
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
92 ;TFT_write_flash_image_addr:
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
93 ; call ext_flash_read_block_start
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
94 ; movff SSP2BUF,win_width+0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
95 ; movwf SSP2BUF ; write to buffer to initiate new read
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
96 ; btfss SSP2STAT, BF ; next byte ready ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
97 ; bra $-2 ; NO - wait...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
98 ; movff SSP2BUF,win_width+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
99 ; movwf SSP2BUF ; write to buffer to initiate new read
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
100 ; btfss SSP2STAT, BF ; next byte ready ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
101 ; bra $-2 ; NO - wait...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
102 ; movff SSP2BUF,win_height
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
103 ; movwf SSP2BUF ; write to buffer to initiate new read
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
104 ; btfss SSP2STAT, BF ; next byte ready ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
105 ; bra $-2 ; NO - wait...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
106 ; movff SSP2BUF,WREG ; drop 4th byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
107 ; movwf SSP2BUF ; write to buffer to initiate new read
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
108 ; btfss SSP2STAT, BF ; next byte ready ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
109 ; bra $-2 ; NO - wait...
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
110 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
111 ; ; Sanity check on header to avoid badly uploaded images.
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
112 ; iorwf WREG ; check height < 256
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
113 ; bnz TFT_write_flash_image_failed
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
114 ; movf win_width+1,W ; check width < 512
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
115 ; andlw 0xFE
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
116 ; bnz TFT_write_flash_image_failed
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
117 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
118 ; ; Center image on win_top, win_left values
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
119 ; bcf STATUS,C ; clear carry
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
120 ; rrcf win_height,W ; and get height/2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
121 ; subwf win_top,F ; top -= height/2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
122 ; rrcf win_width+1,W ; get 9th bit into carry
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
123 ; rrcf win_width+0,W ; get width/2 (in 0..320 range)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
124 ; bcf STATUS,C
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
125 ; rrcf WREG,W ; get width/2 in 0..160 range
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
126 ; subwf win_leftx2,F ; left -= width/2
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
127 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
128 ; rcall TFT_box_write ; inputs : win_top, win_leftx2, win_height, win_width (in 1..320 range)
0
heinrichsweikamp
parents:
diff changeset
129 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
130 ; ; Compute number of pixels to move (result on 17 bits !)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
131 ; clrf TBLPTRU
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
132 ; movf win_width+0,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
133 ; mulwf win_height ; result in PRODL:H
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
134 ; movf win_width+1,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
135 ; bz TFT_write_flash_image_1 ; width > 8bits ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
136 ; movf win_height,W ; YES - add extra
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
137 ; addwf PRODH,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
138 ; rlcf TBLPTRU ; and carry into upper register
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
139 ;TFT_write_flash_image_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
140 ; incf PRODH,F ; pre-condition nested loops
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
141 ; incf TBLPTRU,F
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
142 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
143 ; ; Write pixels
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
144 ; Index_out 0x22 ; frame memory data write start
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
145 ; RS_H ; data
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
146 ;
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
147 ;TFT_write_flash_image_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
148 ; btfss SSP2STAT, BF ; buffer full?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
149 ; bra $-2 ; NO - wait...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
150 ; movff SSP2BUF,PORTH ; read lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
151 ; movwf SSP2BUF ; write to buffer to initiate new read
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
152 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
153 ; btfss SSP2STAT, BF ; buffer full?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
154 ; bra $-2 ; NO - wait...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
155 ; movff SSP2BUF,PORTA ; and read hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
156 ; movwf SSP2BUF ; write to buffer to initiate new read
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
157 ; WR_L
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
158 ; WR_H ; write 1 pixel
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
159 ;
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
160 ; decfsz PRODL,F
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
161 ; bra TFT_write_flash_image_loop
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
162 ; decfsz PRODH,F
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
163 ; bra TFT_write_flash_image_loop
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
164 ; decfsz TBLPTRU,F
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
165 ; bra TFT_write_flash_image_loop
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
166 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
167 ; btfss SSP2STAT, BF ; buffer full?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
168 ; bra $-2 ; NO - wait
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
169 ; movf SSP2BUF,W ; read dummy byte
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
170 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
171 ; bsf flash_ncs ; CS=1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
172 ; movlw 0x00 ; NOP, to stop window mode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
173 ; bra TFT_CmdWrite ; this routine "returns"
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
174 ;
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
175 ; ;---- Draw a 4x4 red square in place of missing images...
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
176 ;TFT_write_flash_image_failed:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
177 ; movlw -1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
178 ; addwf win_leftx2,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
179 ; movlw -2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
180 ; addwf win_top,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
181 ; movlw 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
182 ; movwf win_width+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
183 ; clrf win_width+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
184 ; movlw 4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
185 ; movwf win_height
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
186 ; movlw color_red
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
187 ; rcall TFT_set_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
188 ; goto TFT_box
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
189 ;
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
190 ;;=============================================================================
0
heinrichsweikamp
parents:
diff changeset
191
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
192
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
193 global TFT_ClearScreen
0
heinrichsweikamp
parents:
diff changeset
194 TFT_ClearScreen:
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
195 btfsc screen_type2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
196 bra TFT_ClearScreen_display2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
197 Index_out 0x50 ; window horizontal start address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
198 Parameter_out 0x00, 0x00 ; 0-239
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
199 Index_out 0x51 ; window horizontal end address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
200 Parameter_out 0x00, 0xEF ; 0-239
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
201 Index_out 0x52 ; window vertical start address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
202 Parameter_out 0x00, 0x00 ; 0-319
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
203 Index_out 0x53 ; window vertical end address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
204 Parameter_out 0x01, 0x3F ; 0-319
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
205 Index_out 0x20 ; frame memory horizontal address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
206 Parameter_out 0x00, 0x00 ; 0-239
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
207 Index_out 0x21 ; frame memory vertical address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
208 Parameter_out 0x01, 0x3F ; 0-319
0
heinrichsweikamp
parents:
diff changeset
209
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
210 Index_out 0x22 ; frame memory data write start
0
heinrichsweikamp
parents:
diff changeset
211
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
212 RD_H ; not read
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
213 RS_H ; data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
214 NCS_L ; not CS
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
215 clrf PORTH ; data lower
0
heinrichsweikamp
parents:
diff changeset
216
heinrichsweikamp
parents:
diff changeset
217 movlw d'10'
heinrichsweikamp
parents:
diff changeset
218 movwf tft_temp3
heinrichsweikamp
parents:
diff changeset
219 TFT_ClearScreen2:
heinrichsweikamp
parents:
diff changeset
220 movlw d'30'
heinrichsweikamp
parents:
diff changeset
221 movwf tft_temp2
heinrichsweikamp
parents:
diff changeset
222 TFT_ClearScreen3:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
223 clrf tft_temp1 ; 30*10*256=76800 pixels -> clear complete 240*320
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
224 bcf INTCON,GIE
0
heinrichsweikamp
parents:
diff changeset
225 TFT_ClearScreen4:
heinrichsweikamp
parents:
diff changeset
226 WR_L
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
227 WR_H ; tick
0
heinrichsweikamp
parents:
diff changeset
228 decfsz tft_temp1,F
heinrichsweikamp
parents:
diff changeset
229 bra TFT_ClearScreen4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
230 bsf INTCON,GIE
0
heinrichsweikamp
parents:
diff changeset
231 decfsz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
232 bra TFT_ClearScreen3
heinrichsweikamp
parents:
diff changeset
233 decfsz tft_temp3,F
heinrichsweikamp
parents:
diff changeset
234 bra TFT_ClearScreen2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
235
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
236 movlw 0x00 ; NOP, to stop window mode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
237 bra TFT_CmdWrite ; and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
238
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
239 TFT_ClearScreen_display2:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
240 ; Column Address start
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
241 movlw 0x02
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
242 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
243 movlw 0x00
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
244 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
245 movlw 0x03
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
246 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
247 movlw 0x00
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
248 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
249
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
250 ; Column Address end
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
251 movlw 0x04
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
252 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
253 movlw 0x00
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
254 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
255 movlw 0x05
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
256 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
257 movlw 0xEF
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
258 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
259
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
260 ; Row address start
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
261 movlw 0x06
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
262 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
263 movlw 0x00
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
264 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
265 movlw 0x07
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
266 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
267 movlw 0x00
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
268 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
269
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
270 ; Row address end
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
271 movlw 0x08
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
272 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
273 movlw 0x01
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
274 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
275 movlw 0x09
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
276 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
277 movlw 0x3F
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
278 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
279
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
280 movlw 0x22 ; Start Writing Data to GRAM
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
281 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
282
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
283 bsf tft_rs ; Data!
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
284
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
285 movlw .160
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
286 movwf PRODH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
287 clrf PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
288 TFT_ClearScreen2_display2:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
289 movlw .240
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
290 movwf PRODL
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
291 TFT_ClearScreen3_display2:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
292 bcf tft_nwr
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
293 bsf tft_nwr ; Upper
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
294 bcf tft_nwr
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
295 bsf tft_nwr ; High
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
296 bcf tft_nwr
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
297 bsf tft_nwr ; Lower
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
298 bcf tft_nwr
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
299 bsf tft_nwr ; Upper
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
300 bcf tft_nwr
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
301 bsf tft_nwr ; High
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
302 bcf tft_nwr
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
303 bsf tft_nwr ; Lower
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
304 decfsz PRODL,F
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
305 bra TFT_ClearScreen3_display2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
306 decfsz PRODH,F
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
307 bra TFT_ClearScreen2_display2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
308 return
0
heinrichsweikamp
parents:
diff changeset
309
heinrichsweikamp
parents:
diff changeset
310 ;=============================================================================
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
311
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
312 global TFT_DisplayOff
0
heinrichsweikamp
parents:
diff changeset
313 TFT_DisplayOff:
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
314 clrf CCP1CON ; stop PWM
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
315 bcf PORTC,2 ; Pull PWM out to GND
0
heinrichsweikamp
parents:
diff changeset
316 clrf PORTA
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
317 clrf PORTH
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
318 RD_L ; LOW
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
319 RS_L ; LOW
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
320 bcf tft_nwr
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
321 bcf tft_cs
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
322 bcf tft_nreset
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
323 bsf tft_power ; inverted...
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
324 bcf lightsen_power ; power-down light sensor
0
heinrichsweikamp
parents:
diff changeset
325 return
heinrichsweikamp
parents:
diff changeset
326
heinrichsweikamp
parents:
diff changeset
327 ; -----------------------------
heinrichsweikamp
parents:
diff changeset
328 ; TFT boot
heinrichsweikamp
parents:
diff changeset
329 ; -----------------------------
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
330
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
331 global TFT_boot
0
heinrichsweikamp
parents:
diff changeset
332 TFT_boot:
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
333 clrf CCP1CON ; stop PWM
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
334 bcf PORTC,2 ; Pull PWM out to GND
0
heinrichsweikamp
parents:
diff changeset
335 clrf PORTA
heinrichsweikamp
parents:
diff changeset
336 clrf PORTH
heinrichsweikamp
parents:
diff changeset
337 RD_L ; LOW
heinrichsweikamp
parents:
diff changeset
338 bcf tft_nwr
heinrichsweikamp
parents:
diff changeset
339 nop
heinrichsweikamp
parents:
diff changeset
340 bcf tft_cs
heinrichsweikamp
parents:
diff changeset
341 nop
heinrichsweikamp
parents:
diff changeset
342 bcf tft_nreset
heinrichsweikamp
parents:
diff changeset
343 WAITMS d'1'
heinrichsweikamp
parents:
diff changeset
344 bcf tft_power ; inverted...
heinrichsweikamp
parents:
diff changeset
345 WAITMS d'1'
heinrichsweikamp
parents:
diff changeset
346
heinrichsweikamp
parents:
diff changeset
347 RD_H ; Keep high
heinrichsweikamp
parents:
diff changeset
348 WR_H ;
heinrichsweikamp
parents:
diff changeset
349 NCS_L ; Not CS
heinrichsweikamp
parents:
diff changeset
350
heinrichsweikamp
parents:
diff changeset
351 WAITMS d'2'
heinrichsweikamp
parents:
diff changeset
352 bsf tft_nreset
461
4927ba3bd3b5 repeated init (For screen 2 issues)
heinrichsweikamp
parents: 441
diff changeset
353 WAITMS d'5'
4927ba3bd3b5 repeated init (For screen 2 issues)
heinrichsweikamp
parents: 441
diff changeset
354 bcf tft_nreset
4927ba3bd3b5 repeated init (For screen 2 issues)
heinrichsweikamp
parents: 441
diff changeset
355 WAITMS d'5'
4927ba3bd3b5 repeated init (For screen 2 issues)
heinrichsweikamp
parents: 441
diff changeset
356 bsf tft_nreset
0
heinrichsweikamp
parents:
diff changeset
357 WAITMS d'150'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
358 bsf lightsen_power ; supply power to light sensor
0
heinrichsweikamp
parents:
diff changeset
359
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
360 ; Data Transfer Synchronization
0
heinrichsweikamp
parents:
diff changeset
361 Parameter_out 0x00, 0x00
heinrichsweikamp
parents:
diff changeset
362 Parameter_out 0x00, 0x00
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
363
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
364 btfsc screen_type2 ; Display 2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
365 bra TFT_boot_screen2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
366
441
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 436
diff changeset
367 ; Get screentype from Bootloader-Info
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
368 movlw 0x7B
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
369 movwf TBLPTRL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
370 movlw 0xF7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
371 movwf TBLPTRH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
372 movlw 0x01
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
373 movwf TBLPTRU
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
374 TBLRD*+ ; reads .110 for cR and USB OSTC3, .0 for BLE (2 and 3), and .2 for display1 OSTC
441
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 436
diff changeset
375 movlw 0x02
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 436
diff changeset
376 cpfseq TABLAT
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
377 bra TFT_boot_0 ; display0
360
5f142cff43f6 hardware support
heinrichsweikamp
parents: 312
diff changeset
378
5f142cff43f6 hardware support
heinrichsweikamp
parents: 312
diff changeset
379 TFT_boot_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
380 ; Init through config table...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
381 movlw 0x74
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
382 movwf TBLPTRL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
383 movlw 0xF7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
384 movwf TBLPTRH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
385 movlw 0x01
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
386 movwf TBLPTRU
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
387 bsf screen_type
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
388 bra TFT_boot_com
360
5f142cff43f6 hardware support
heinrichsweikamp
parents: 312
diff changeset
389
441
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 436
diff changeset
390 TFT_boot_0:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
391 ; Init through config table...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
392 movlw LOW display0_config_table
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
393 movwf TBLPTRL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
394 movlw HIGH display0_config_table
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
395 movwf TBLPTRH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
396 movlw UPPER display0_config_table
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
397 movwf TBLPTRU
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
398 bcf screen_type
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
399
360
5f142cff43f6 hardware support
heinrichsweikamp
parents: 312
diff changeset
400 TFT_boot_com:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
401 rcall display0_init_loop
0
heinrichsweikamp
parents:
diff changeset
402
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
403 Index_out 0x03
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
404 btfsc flip_screen ; 180° rotation ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
405 bra TFT_boot2 ; YES
360
5f142cff43f6 hardware support
heinrichsweikamp
parents: 312
diff changeset
406
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
407 btfss screen_type ; display1?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
408 bra TFT_boot1a ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
409 Parameter_out 0x10, 0x00 ; display1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
410 bra TFT_boot3
360
5f142cff43f6 hardware support
heinrichsweikamp
parents: 312
diff changeset
411 TFT_boot1a:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
412 Parameter_out 0x50, 0x20 ; display0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
413 bra TFT_boot3
152
19ad15f04f60 BUGFIX: Clear Setpoint-Fallback warning when in bailout
heinrichsweikamp
parents: 151
diff changeset
414 TFT_boot2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
415 btfss screen_type ; display1?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
416 bra TFT_boot2a ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
417 Parameter_out 0x10, 0x30 ; display1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
418 bra TFT_boot3
360
5f142cff43f6 hardware support
heinrichsweikamp
parents: 312
diff changeset
419 TFT_boot2a:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
420 Parameter_out 0x50, 0x10 ; display0
152
19ad15f04f60 BUGFIX: Clear Setpoint-Fallback warning when in bailout
heinrichsweikamp
parents: 151
diff changeset
421 TFT_boot3:
0
heinrichsweikamp
parents:
diff changeset
422 Index_out 0x22
225
31088352ee32 BUGFIX: Show dives with >999mins divetime correctly
heinrichsweikamp
parents: 152
diff changeset
423 rcall TFT_ClearScreen
0
heinrichsweikamp
parents:
diff changeset
424 Index_out 0x07
312
b2f6a4b01e64 Config table for alternative display
heinrichsweikamp
parents: 275
diff changeset
425 Parameter_out 0x01, 0x33
0
heinrichsweikamp
parents:
diff changeset
426 return
heinrichsweikamp
parents:
diff changeset
427
heinrichsweikamp
parents:
diff changeset
428 display0_config_table:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
429 ; Reg, Dat0, Dat1 or 0xFF,0x00,0x00 for end
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
430 db 0xA4,0x00,0x01,0xFF,.002,0x00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
431 db 0x09,0x00,0x01,0x92,0x04,0x00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
432 db 0x93,0x04,0x02,0x94,0x00,0x02
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
433 db 0x07,0x00,0x00,0x10,0x04,0x30
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
434 db 0x11,0x02,0x37,0x12,0x11,0x8D
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
435 db 0x13,0x11,0x00,0x01,0x01,0x00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
436 db 0x02,0x02,0x00,0x03,0x50,0x20
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
437 db 0x0A,0x00,0x08,0x0D,0x00,0x00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
438 db 0x0E,0x00,0x30,0xFF,.151,0x00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
439 db 0x12,0x11,0xBD,0x20,0x00,0x00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
440 db 0x21,0x00,0x00,0x30,0x06,0x02
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
441 db 0x31,0x56,0x0D,0x32,0x05,0x07
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
442 db 0x33,0x06,0x09,0x34,0x00,0x00
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
443 db 0x35,0x09,0x06,0x36,0x57,0x05
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
444 db 0x37,0x0D,0x06,0x38,0x02,0x06
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
445 db 0x39,0x00,0x00,0xFF,0x00,0x00
0
heinrichsweikamp
parents:
diff changeset
446
heinrichsweikamp
parents:
diff changeset
447 display0_init_loop:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
448 TBLRD*+
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
449 movlw 0xFF
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
450 cpfseq TABLAT
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
451 bra display0_config_write ; write config pair to display
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
452 ; Delay ms or quit (return)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
453 TBLRD*+
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
454 tstfsz TABLAT ; end of config?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
455 bra $+4 ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
456 return ; YES - done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
457 movf TABLAT,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
458 call WAITMSX ; wait WREG milliseconds
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
459 TBLRD*+ ; dummy read (Third byte of delay command)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
460 bra display0_init_loop ; loop
0
heinrichsweikamp
parents:
diff changeset
461
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
462 display0_config_write: ; with command in WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
463 movf TABLAT,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
464 rcall TFT_CmdWrite ; write command
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
465 TBLRD*+ ; get config0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
466 movff TABLAT,PORTA
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
467 TBLRD*+ ; get config1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
468 movf TABLAT,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
469 rcall TFT_DataWrite ; write config
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
470 bra display0_init_loop ; loop
0
heinrichsweikamp
parents:
diff changeset
471
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
472 TFT_boot_screen2:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
473 bsf tft_nwr ; release bus.
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
474 rcall display1_init ; Init sequence
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
475
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
476 btfss flip_screen ; 180° rotation ?
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
477 bra TFT_ClearScreen ; No, done. Clearscreen and return
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
478 ; flip the GRAM
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
479 Index_out 0x16
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
480 movlw 0x48 ; Flip image in the GRAM (Very elegant with display2...)
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
481 rcall TFT_DataWrite ; Write config
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
482 bra TFT_ClearScreen ; Clearscreen and return
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
483
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
484
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
485 display1_init:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
486 movlw LOW 0x1F8BC
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
487 movwf TBLPTRL
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
488 movlw HIGH 0x1F8BC
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
489 movwf TBLPTRH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
490 movlw UPPER 0x1F8BC
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
491 movwf TBLPTRU
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
492 display1_init_loop:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
493 TBLRD*+
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
494 movlw 0xFF
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
495 cpfseq TABLAT
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
496 bra display1_config_write ; Write Config pair to Display
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
497 ; Delay ms or quit (return)
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
498 TBLRD*+
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
499 tstfsz TABLAT ; End of config?
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
500 bra $+4 ; No
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
501 return ; Done.
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
502 movf TABLAT,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
503 call WAITMSX ; Wait WREG milliseconds
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
504 bra display1_init_loop ; Loop
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
505
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
506 display1_config_write: ; With command in WREG
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
507 movf TABLAT,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
508 rcall TFT_CmdWrite ; Write command
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
509 TBLRD*+ ; Get config
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
510 movf TABLAT,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
511 rcall TFT_DataWrite ; Write config
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
512 bra display1_init_loop ; Loop
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
513
0
heinrichsweikamp
parents:
diff changeset
514
heinrichsweikamp
parents:
diff changeset
515 ;=============================================================================
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
516
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
517 global TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
518 TFT_CmdWrite:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
519 RS_L ; command
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
520 btfsc screen_type2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
521 bra TFT_CmdWrite_screen2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
522 clrf PORTA ; upper
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
523 bcf INTCON,GIE
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
524 movwf PORTH ; lower
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
525 WR_L
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
526 WR_H ; tick
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
527 bsf INTCON,GIE
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
528 return
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
529 TFT_CmdWrite_screen2:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
530 movwf PORTH ; Lower
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 return;
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
534
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
535 global TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
536 TFT_DataWrite:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
537 RS_H ; data
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
538 btfsc screen_type2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
539 bra TFT_DataWrite_screen2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
540 bcf INTCON,GIE
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
541 movwf PORTH ; lower
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
542 WR_L
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
543 WR_H ; tick
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
544 bsf INTCON,GIE
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
545 return
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
546 TFT_DataWrite_screen2:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
547 movwf PORTH ; Lower
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
548 WR_L
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
549 WR_H ; Tick
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
550 return
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
551
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
552 ;=============================================================================
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
553
0
heinrichsweikamp
parents:
diff changeset
554 ; Smooth lighting-up of the display:
heinrichsweikamp
parents:
diff changeset
555 ;
heinrichsweikamp
parents:
diff changeset
556 ; Trashes: WREG, PRODL
heinrichsweikamp
parents:
diff changeset
557 ; Typical usage:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
558 ; clrf CCPR1L ; backlight off
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
559 ; [draw splash screen]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
560 ; call TFT_DisplayFadeIn
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
561
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
562 global TFT_Display_FadeIn
0
heinrichsweikamp
parents:
diff changeset
563 TFT_Display_FadeIn:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
564 movlw CCP1CON_VALUE ; see hwos.inc
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
565 movwf CCP1CON
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
566 bsf tft_is_dimming ; TFT is dimming, ignore ambient sensor
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
567 clrf CCPR1L ; backlight off - to be sure
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
568 movff max_CCPR1L,PRODL
0
heinrichsweikamp
parents:
diff changeset
569 TFT_Display_FadeIn_0:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
570 incf CCPR1L,F ; duty cycle
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
571 WAITMS d'2'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
572 decfsz PRODL,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
573 bra TFT_Display_FadeIn_0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
574 bcf tft_is_dimming ; dimming done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
575 return
0
heinrichsweikamp
parents:
diff changeset
576
heinrichsweikamp
parents:
diff changeset
577 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
578 ; Smooth lighting-off of the display:
heinrichsweikamp
parents:
diff changeset
579 ; Trashes: WREG, PRODL
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
580
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
581 global TFT_Display_FadeOut
0
heinrichsweikamp
parents:
diff changeset
582 TFT_Display_FadeOut:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
583 movff max_CCPR1L,PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
584 bsf tft_is_dimming ; TFT is dimming, ignore ambient sensor
0
heinrichsweikamp
parents:
diff changeset
585 TFT_Display_FadeOut_0:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
586 movff PRODL,CCPR1L ; duty cycle
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
587 WAITMS d'1'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
588 decfsz PRODL,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
589 bra TFT_Display_FadeOut_0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
590 clrf CCPR1L
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
591 return
0
heinrichsweikamp
parents:
diff changeset
592
heinrichsweikamp
parents:
diff changeset
593 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
594
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
595 global box_std_block, box_black_block, box_color_block
0
heinrichsweikamp
parents:
diff changeset
596
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
597 box_std_block: ; use white color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
598 setf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
599 bra box_common
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
600 box_black_block: ; use black color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
601 clrf WREG
0
heinrichsweikamp
parents:
diff changeset
602 box_common:
heinrichsweikamp
parents:
diff changeset
603 box_color_block:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
604 rcall TFT_set_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
605 VARARGS_BEGIN
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
606 VARARGS_GET8 win_top
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
607 VARARGS_GET8 win_height
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
608 VARARGS_GET8 win_leftx2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
609 VARARGS_GET8 win_width
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
610 VARARGS_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
611 bra TFT_box
0
heinrichsweikamp
parents:
diff changeset
612
heinrichsweikamp
parents:
diff changeset
613 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
614
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
615 global box_frame_std, box_frame_common, box_frame_color, box_frame_color16
0
heinrichsweikamp
parents:
diff changeset
616
heinrichsweikamp
parents:
diff changeset
617 box_frame_std:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
618 setf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
619 rcall TFT_set_color
0
heinrichsweikamp
parents:
diff changeset
620 box_frame_common:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
621 VARARGS_BEGIN
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
622 VARARGS_GET8 win_top
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
623 VARARGS_GET8 win_height
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
624 VARARGS_GET8 win_leftx2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
625 VARARGS_GET8 win_width
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
626 VARARGS_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
627 bra TFT_frame
0
heinrichsweikamp
parents:
diff changeset
628 box_frame_color:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
629 rcall TFT_set_color
0
heinrichsweikamp
parents:
diff changeset
630 box_frame_color16:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
631 bra box_frame_common
0
heinrichsweikamp
parents:
diff changeset
632
434
a001f170a1f7 hunting a bug in the logbook (Day 3)
heinrichsweikamp
parents: 432
diff changeset
633 ;;=============================================================================
a001f170a1f7 hunting a bug in the logbook (Day 3)
heinrichsweikamp
parents: 432
diff changeset
634 ;; Init for half_pixel_write
a001f170a1f7 hunting a bug in the logbook (Day 3)
heinrichsweikamp
parents: 432
diff changeset
635 ;; Set column register on TFT device, and current color.
a001f170a1f7 hunting a bug in the logbook (Day 3)
heinrichsweikamp
parents: 432
diff changeset
636 ;; Inputs: win_leftx2
a001f170a1f7 hunting a bug in the logbook (Day 3)
heinrichsweikamp
parents: 432
diff changeset
637 ;; Outputs: win_color:2
a001f170a1f7 hunting a bug in the logbook (Day 3)
heinrichsweikamp
parents: 432
diff changeset
638 ;; Trashed: WREG, PROD
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
639 ;
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
640 ; global init_pixel_write
434
a001f170a1f7 hunting a bug in the logbook (Day 3)
heinrichsweikamp
parents: 432
diff changeset
641 ;init_pixel_write:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
642 ; movf win_leftx2,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
643 ; mullw 2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
644 ; rcall pixel_write_col320 ; start address vertical (.0 - .319)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
645 ; setf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
646 ; bra TFT_set_color
0
heinrichsweikamp
parents:
diff changeset
647
heinrichsweikamp
parents:
diff changeset
648 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
649 ; Writes two half-pixels at position (win_top,win_leftx2)
heinrichsweikamp
parents:
diff changeset
650 ; Inputs: win_leftx2, win_top, win_color:2
heinrichsweikamp
parents:
diff changeset
651 ; Trashed: WREG, PROD
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
652
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
653 global pixel_write
0
heinrichsweikamp
parents:
diff changeset
654 pixel_write:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
655 movf win_leftx2,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
656 mullw 2 ; win_leftx2 x 2 -> PRODH:PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
657 rcall pixel_write_col320 ; start address vertical (.0 - .319)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
658 rcall half_pixel_write ; write this half-one
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
659 movf win_leftx2,W ; address of next one
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
660 mullw 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
661 infsnz PRODL ; +1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
662 incf PRODH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
663 rcall pixel_write_col320
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
664 bra half_pixel_write ; note: Cmd 0x20 is mandatory, because
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
665 ; of the auto-increment going vertical
0
heinrichsweikamp
parents:
diff changeset
666
heinrichsweikamp
parents:
diff changeset
667 global pixel_write_col320
heinrichsweikamp
parents:
diff changeset
668 pixel_write_col320:
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
669 btfsc screen_type2 ; display2?
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
670 bra pixel_write_col320_d2 ; Yes
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
671 btfsc screen_type ; display1?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
672 bra pixel_write_col320_d1 ; YES
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
673 ; Display0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
674 btfss flip_screen ; 180° rotation?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
675 bra pixel_write_noflip_H ; NO
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
676 bra pixel_write_flip_H ; YES
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
677 pixel_write_col320_d1: ; Display1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
678 btfsc flip_screen ; 180° rotation?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
679 bra pixel_write_noflip_H ; YES for d1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
680 pixel_write_flip_H: ; flip d0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
681 movf PRODL,W ; 16 bits 319 - PROD --> PROD
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
682 sublw LOW(.319) ; 319-W --> W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
683 movwf PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
684 movf PRODH,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
685 btfss STATUS,C ; borrow = /CARRY
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
686 incf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
687 sublw HIGH(.319)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
688 movwf PRODH
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
689
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
690 pixel_write_noflip_H:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
691 Index_out 0x21 ; frame memory vertical address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
692 bra TFT_DataWrite_PROD ; and return...
0
heinrichsweikamp
parents:
diff changeset
693
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
694 pixel_write_col320_d2:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
695 movlw 0x06
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
696 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
697 movf PRODH,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
698 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
699 movlw 0x07
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
700 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
701 movf PRODL,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
702 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
703
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
704 incf PRODL,F
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
705 movlw .0
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
706 addwfc PRODH,F ;+1
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
707
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
708 movlw 0x08
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
709 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
710 movf PRODH,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
711 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
712 movlw 0x09
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
713 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
714 movf PRODL,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
715 bra TFT_DataWrite ; And return...
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
716
0
heinrichsweikamp
parents:
diff changeset
717 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
718 ; Writes one half-pixel at position (win_top,win_leftx2).
heinrichsweikamp
parents:
diff changeset
719 ; Inputs: win_leftx2, win_top, win_color:2
heinrichsweikamp
parents:
diff changeset
720 ; Trashed: WREG, PROD
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
721
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
722 global half_pixel_write
0
heinrichsweikamp
parents:
diff changeset
723 half_pixel_write:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
724 movf win_top,W ; d'0' ... d'239'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
725 ; Variant with Y position in WREG.
0
heinrichsweikamp
parents:
diff changeset
726 half_pixel_write_1:
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
727 btfsc screen_type2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
728 bra half_pixel_write_1_display1 ; Yes.
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
729
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
730 btfss flip_screen ; 180° rotation?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
731 sublw .239 ; 239-Y --> Y
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
732 mullw .1 ; copy row to PRODL (PRODH=0)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
733 Index_out 0x20 ; frame memory horizontal address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
734 rcall TFT_DataWrite_PROD
0
heinrichsweikamp
parents:
diff changeset
735
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
736 Index_out 0x22 ; frame memory data write start
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
737 RS_H ; data
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
738 bcf INTCON,GIE
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
739 movff win_color1,PORTA ; upper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
740 movff win_color2,PORTH ; lower
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
741 WR_L
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
742 WR_H ; tick
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
743 bsf INTCON,GIE
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
744 return
0
heinrichsweikamp
parents:
diff changeset
745
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
746 half_pixel_write_1_display1:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
747 mullw 1 ; Copy row to PRODL (PRODH=0)
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
748 ; Row address start
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
749 movlw 0x02
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
750 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
751 movlw .0
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
752 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
753 movlw 0x03
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
754 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
755 movf PRODL,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
756 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
757
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
758 incf PRODL,F
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
759
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
760 movlw 0x04
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
761 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
762 movlw .0
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
763 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
764 movlw 0x05
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
765 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
766 movf PRODL,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
767 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
768
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
769 movff win_color1,PRODH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
770 movff win_color2,PRODL
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
771 rcall convert_for_display2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
772
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
773 movlw 0x22 ; Start Writing Data to GRAM
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
774 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
775 RS_H ; Data
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
776 movff win_color5, PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
777 WR_L
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
778 WR_H ; Tick
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
779 movff win_color4, PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
780 WR_L
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
781 WR_H ; Tick
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
782 movff win_color3, PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
783 WR_L
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
784 WR_H ; Tick
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
785 return
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
786
0
heinrichsweikamp
parents:
diff changeset
787 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
788 ; Writes a vertical line of half-pixel at position (win_top,win_leftx2,win_height).
heinrichsweikamp
parents:
diff changeset
789 ; Inputs: win_leftx2, win_top, win_height, win_color:2
heinrichsweikamp
parents:
diff changeset
790 ; Trashed: WREG, PROD, TABLAT, TBLPTRL
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
791
0
heinrichsweikamp
parents:
diff changeset
792 global half_vertical_line
heinrichsweikamp
parents:
diff changeset
793 half_vertical_line:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
794 clrf TABLAT ; loop index
0
heinrichsweikamp
parents:
diff changeset
795
heinrichsweikamp
parents:
diff changeset
796 half_vertical_line_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
797 movf win_leftx2,W ; init X position
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
798 mullw .2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
799 movf TABLAT,W ; get loop index
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
800 andlw .1 ; just low bit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
801 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
802 rcall pixel_write_col320 ; start address vertical (.0 - .319)
0
heinrichsweikamp
parents:
diff changeset
803
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
804 movf win_height,W ; index reached height (bank0 read) ?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
805 xorwf TABLAT,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
806 btfsc STATUS,Z ; Equal ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
807 return ; YES - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
808 movf win_top,W ; Y = top + index (bank0 read)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
809 addwf TABLAT,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
810 rcall half_pixel_write_1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
811 incf TABLAT,F ; index++
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
812 bra half_vertical_line_loop
0
heinrichsweikamp
parents:
diff changeset
813
heinrichsweikamp
parents:
diff changeset
814 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
815 ; Writes a horizontal line of half-pixel at position (win_top,win_leftx2,win_width).
heinrichsweikamp
parents:
diff changeset
816 ; Inputs: win_leftx2, win_top, win_width, win_color:2
heinrichsweikamp
parents:
diff changeset
817 ; Trashed: WREG, PROD, TABLAT, TBLPTRL
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
818
0
heinrichsweikamp
parents:
diff changeset
819 global half_horizontal_line
heinrichsweikamp
parents:
diff changeset
820 half_horizontal_line:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
821 clrf TABLAT ; loop index
0
heinrichsweikamp
parents:
diff changeset
822
heinrichsweikamp
parents:
diff changeset
823 half_horizontal_line_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
824 movf win_leftx2,W ; init X position
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
825 mullw .2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
826 rcall pixel_write_col320 ; start address vertical (.0 - .319)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
827 movf win_width,W ; index reached height (bank0 read) ?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
828 xorwf TABLAT,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
829 btfsc STATUS,Z ; equal ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
830 return ; YES - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
831 movf win_top,W ; Y = top + index (bank0 read)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
832 addwf TABLAT,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
833 rcall half_pixel_write_1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
834 incf TABLAT,F ; index++
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
835 bra half_horizontal_line_loop
0
heinrichsweikamp
parents:
diff changeset
836
heinrichsweikamp
parents:
diff changeset
837
heinrichsweikamp
parents:
diff changeset
838 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
839 ; TFT Data Cmd via W
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
840
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
841 global TFT_DataWrite_PROD
0
heinrichsweikamp
parents:
diff changeset
842 TFT_DataWrite_PROD:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
843 ; RD_H ; keep high
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
844 RS_H ; data
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
845 btfsc screen_type2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
846 bra TFT_DataWrite_PROD_display2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
847 bcf INTCON,GIE
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
848 movff PRODH,PORTA ; move high byte to PORTA
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
849 movff PRODL,PORTH ; move low byte to PORTH
0
heinrichsweikamp
parents:
diff changeset
850 WR_L
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
851 WR_H ; tick
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
852 bsf INTCON,GIE
0
heinrichsweikamp
parents:
diff changeset
853 return
heinrichsweikamp
parents:
diff changeset
854
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
855 TFT_DataWrite_PROD_display2:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
856 movff PRODH,PORTH ; Move high byte to PORTH (DISPLAY is bigendian)
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
857 WR_L
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
858 WR_H
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
859 movff PRODL,PORTH ; Move low byte to PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
860 WR_L
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
861 WR_H
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
862 movff win_color3,PORTH ; Move low(est) byte to PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
863 WR_L
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
864 WR_H
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
865 return
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
866
0
heinrichsweikamp
parents:
diff changeset
867 TFT_DataRead_PROD:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
868 Index_out 0x22 ; frame memory data read start
360
5f142cff43f6 hardware support
heinrichsweikamp
parents: 312
diff changeset
869 TFT_CmdRead_PROD:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
870 setf TRISA ; port A as input
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
871 setf TRISH ; port H as input
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
872 RS_H ; data
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
873 WR_H ; not write
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
874 RD_L ; read
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
875 nop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
876 nop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
877 nop
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
878 RD_H ; tick
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
879 nop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
880 nop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
881 nop
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
882 RD_L ; read
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
883 nop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
884 ;nop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
885 ;nop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
886 movff PORTA,PRODH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
887 movff PORTH,PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
888 RD_H ; tick
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
889 nop
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
890 clrf TRISA ; port A as output
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
891 clrf TRISH ; port H as output
0
heinrichsweikamp
parents:
diff changeset
892 return
heinrichsweikamp
parents:
diff changeset
893
heinrichsweikamp
parents:
diff changeset
894 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
895 ; Output TFT Window Address commands
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
896 ; Inputs : win_top, win_leftx2, win_height, win_width
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
897 ; Output : PortA/PortH commands
0
heinrichsweikamp
parents:
diff changeset
898 ; Trashed: PROD
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
899
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
900 global TFT_box_write
0
heinrichsweikamp
parents:
diff changeset
901 TFT_box_write:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
902 movf win_leftx2,W ; compute left = 2 * leftx2 --> PROD
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
903 mullw 2
0
heinrichsweikamp
parents:
diff changeset
904
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
905 btfsc screen_type2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
906 bra TFT_box_write_display2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
907
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
908 global TFT_box_write_16bit_win_left
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
909 TFT_box_write_16bit_win_left: ; Wwth column in PRODL:PRODH
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
910 btfsc screen_type ; display1?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
911 bra TFT_box_write_16bit_win_left_d1 ; YES
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
912 ; Display0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
913 btfsc flip_screen ; 180° rotation?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
914 bra DISP_box_flip_H ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
915 bra TFT_box_write_16bit_win_left_com ; NO
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
916 TFT_box_write_16bit_win_left_d1: ; Display1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
917 btfss flip_screen ; 180° rotation?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
918 bra DISP_box_flip_H ; NO for d1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
919 ; Yes for d1
361
631cbfea3757 1.85beta release
heinrichsweikamp
parents: 360
diff changeset
920 TFT_box_write_16bit_win_left_com:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
921 ;---- Normal horizontal window ---------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
922 Index_out 0x52 ; window vertical start address
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
923 rcall TFT_DataWrite_PROD ; output left
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
924 Index_out 0x21 ; frame memory vertical address
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
925 rcall TFT_DataWrite_PROD ; output left
0
heinrichsweikamp
parents:
diff changeset
926
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
927 movf win_width+0,W ; right = left + width - 1
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
928 addwf PRODL,F
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
929 movf win_width+1,W
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
930 addwfc PRODH,F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
931 decf PRODL,F ; decrement result
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
932 btfss STATUS,C
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
933 decf PRODH,F
0
heinrichsweikamp
parents:
diff changeset
934
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
935 Index_out 0x53 ; window vertical end address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
936 rcall TFT_DataWrite_PROD
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
937 bra DISP_box_noflip_H
0
heinrichsweikamp
parents:
diff changeset
938
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
939 ;---- Flipped horizontal window --------------------------------------
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
940 DISP_box_flip_H:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
941 movf PRODL,W ; 16 bits 319 - PROD --> PROD
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
942 sublw LOW(.319) ; 319 - WREG --> WREG
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
943 movwf PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
944 movf PRODH,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
945 btfss STATUS,C ; borrow = /CARRY
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
946 incf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
947 sublw HIGH(.319)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
948 movwf PRODH
152
19ad15f04f60 BUGFIX: Clear Setpoint-Fallback warning when in bailout
heinrichsweikamp
parents: 151
diff changeset
949
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
950 Index_out 0x53 ; window vertical start address
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
951 rcall TFT_DataWrite_PROD ; output left
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
952 Index_out 0x21 ; frame memory vertical address
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
953 rcall TFT_DataWrite_PROD ; output left
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
954
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
955 movf win_width+0,W ; 16 bits PROD - width --> PROD
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
956 subwf PRODL,F ; PRODL - WREG --> PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
957 movf win_width+1,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
958 subwfb PRODH,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
959 infsnz PRODL ; PROD + 1 --> PROD
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
960 incf PRODH
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
961
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
962 Index_out 0x52 ; window vertical end address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
963 rcall TFT_DataWrite_PROD
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
964
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
965 DISP_box_noflip_H:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
966 btfss flip_screen ; 180° rotation ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
967 bra TFT_box_noflip_V ; NO
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
968
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
969 ;---- Flipped vertical window -----------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
970 movff win_top,PRODH ; top --> PRODH (first byte)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
971 movf win_height,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
972 addwf PRODH,W
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
973 decf WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
974 movwf PRODL ; top + height - 1 --> PRODL (second byte)
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
975
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
976 Index_out 0x50 ; window horizontal start address
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
977 movf PRODH,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
978 rcall TFT_DataWrite ; lower (and tick)
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
979
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
980 Index_out 0x51 ; window horizontal end address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
981 movf PRODL,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
982 rcall TFT_DataWrite ; lower (and tick)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
983
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
984 Index_out 0x20 ; frame memory horizontal address
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
985 movf PRODH,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
986 bra TFT_DataWrite ; lower (and tick) and return
151
5cb177f0948a work on flip screen...
heinrichsweikamp
parents: 125
diff changeset
987
152
19ad15f04f60 BUGFIX: Clear Setpoint-Fallback warning when in bailout
heinrichsweikamp
parents: 151
diff changeset
988 TFT_box_noflip_V:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
989 ;---- Normal vertical window ----------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
990 movff win_top,PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
991 movf win_height,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
992 addwf PRODL,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
993 sublw .240 ; 240 - top - height
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
994 movwf PRODH ; first byte
0
heinrichsweikamp
parents:
diff changeset
995
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
996 movf PRODL,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
997 sublw .239 ; 239 - top
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
998 movwf PRODL ; --> second byte
0
heinrichsweikamp
parents:
diff changeset
999
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1000 Index_out 0x50 ; window horizontal start address
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
1001 movf PRODH,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1002 rcall TFT_DataWrite ; lower (and tick)
0
heinrichsweikamp
parents:
diff changeset
1003
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1004 Index_out 0x51 ; window horizontal end address
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
1005 movf PRODL,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1006 rcall TFT_DataWrite ; lower (and tick)
0
heinrichsweikamp
parents:
diff changeset
1007
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1008 Index_out 0x20 ; frame memory horizontal address
432
929feb0da4f5 hunting a bug in the logbook (Day 2)
heinrichsweikamp
parents: 431
diff changeset
1009 movf PRODL,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1010 bra TFT_DataWrite ; lower (and tick) and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1011
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1012 TFT_box_write_display2:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1013 movlw 0x06
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1014 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1015 movf PRODH,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1016 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1017 movlw 0x07
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1018 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1019 movf PRODL,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1020 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1021
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1022 movf win_width+0,W ; right = left + width - 1
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1023 addwf PRODL,F
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1024 movf win_width+1,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1025 addwfc PRODH,F
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1026 decf PRODL,F,A ; decrement result
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1027 btfss STATUS,C
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1028 decf PRODH,F,A
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1029
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1030 movlw 0x08
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1031 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1032 movf PRODH,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1033 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1034 movlw 0x09
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1035 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1036 movf PRODL,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1037 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1038
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1039 ;---- Normal vertical window -----------------------------------------
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1040 ; Output (top) (bottom)
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1041 movff win_top,PRODH ; top --> PRODH (first byte)
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1042 movff win_height,WREG
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1043 addwf PRODH,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1044 decf WREG
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1045 movwf PRODL ; top+height-1 --> PRODL (second byte)
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1046
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1047 movlw 0x02
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1048 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1049 movlw 0x00
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1050 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1051 movlw 0x03
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1052 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1053 movf PRODH,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1054 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1055
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1056 movlw 0x04
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1057 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1058 movlw 0x00
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1059 rcall TFT_DataWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1060 movlw 0x05
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1061 rcall TFT_CmdWrite
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1062 movf PRODL,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1063 bra TFT_DataWrite ; and return
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1064
0
heinrichsweikamp
parents:
diff changeset
1065
heinrichsweikamp
parents:
diff changeset
1066 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1067 ; TFT_frame : draw a frame around current box with current color
0
heinrichsweikamp
parents:
diff changeset
1068 ; Inputs: win_top, win_leftx2, win_height, win_width, win_color1, win_color2
heinrichsweikamp
parents:
diff changeset
1069 ; Outputs: (none)
heinrichsweikamp
parents:
diff changeset
1070 ; Trashed: WREG, PROD, aa_start:2, aa_end:2
heinrichsweikamp
parents:
diff changeset
1071
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1072 global TFT_frame
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1073 TFT_frame:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1074 movff win_top,save_top ; backup everything
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1075 movff win_height,save_height
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1076 movff win_leftx2,save_left
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1077 movff win_width,save_width
0
heinrichsweikamp
parents:
diff changeset
1078
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1079 ;---- TOP line -----------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1080 movlw .1 ; row ~ height = 1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1081 movwf win_height
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1082 rcall TFT_box
0
heinrichsweikamp
parents:
diff changeset
1083
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1084 ;---- BOTTOM line --------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1085 movff save_top,PRODL ; get back top
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1086 movff save_height,WREG ; get back height
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1087 addwf PRODL,W ; top + height
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1088 decf WREG ; top + height - 1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1089 movwf win_top ; top + height - 1 --> top
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1090 rcall TFT_box
0
heinrichsweikamp
parents:
diff changeset
1091
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1092 ;---- LEFT column --------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1093 movff save_top,win_top ; restore top/height
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1094 movff save_height,win_height
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1095 movlw .1 ; column ~ width = 1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1096 movwf win_width+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1097 rcall TFT_box
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1098
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1099 ;---- RIGHT column -------------------------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1100 movff save_left,WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1101 movff save_width,PRODL
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1102 addwf PRODL,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1103 decf WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1104 movwf win_leftx2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1105 rcall TFT_box
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1106
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1107 ;---- Restore everything -------------------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1108 movff save_left,win_leftx2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1109 movff save_width,win_width
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1110 return
0
heinrichsweikamp
parents:
diff changeset
1111
heinrichsweikamp
parents:
diff changeset
1112 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1113 ; TFT_box: fills current box with current color
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1114 ; Inputs : win_top, win_leftx2, win_height, win_width, win_color1, win_color2
0
heinrichsweikamp
parents:
diff changeset
1115 ; Outputs: (none)
heinrichsweikamp
parents:
diff changeset
1116 ; Trashed: WREG, PROD
heinrichsweikamp
parents:
diff changeset
1117
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1118 global TFT_box
0
heinrichsweikamp
parents:
diff changeset
1119 TFT_box:
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1120 btfsc screen_type2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1121 bra TFT_box_display2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1122 ;---- Define Window ------------------------------------------------------
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1123 bcf STATUS,C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1124 rlcf win_width+0,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1125 rlcf win_width+1,F ; x2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1126 rcall TFT_box_write ; setup box
0
heinrichsweikamp
parents:
diff changeset
1127
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1128 global TFT_box_16bit_win_left
83
eb72c8865f47 Test with graphic compass
heinrichsweikamp
parents: 0
diff changeset
1129 TFT_box_16bit_win_left:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1130 bcf STATUS,C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1131 rrcf win_width+1,F ; width /= 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1132 rrcf win_width+0,F
0
heinrichsweikamp
parents:
diff changeset
1133
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1134 ;---- Fill Window --------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1135 Index_out 0x22 ; frame memory data write start
0
heinrichsweikamp
parents:
diff changeset
1136
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1137 clrf PRODH ; column counter
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1138 RS_H ; data
0
heinrichsweikamp
parents:
diff changeset
1139
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1140 TFT_box2: ; loop height times
0
heinrichsweikamp
parents:
diff changeset
1141 movff win_height,PRODL
heinrichsweikamp
parents:
diff changeset
1142
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1143 TFT_box3: ; loop width times
436
95ee78f4a974 no screen reboot after logbook exit
heinrichsweikamp
parents: 434
diff changeset
1144 bcf INTCON,GIE
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1145 movff win_color1,PORTA ; upper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1146 movff win_color2,PORTH ; lower
0
heinrichsweikamp
parents:
diff changeset
1147 WR_L
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1148 WR_H ; tick
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1149
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1150 ; movff win_color1,PORTA ; upper
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1151 ; movff win_color2,PORTH ; lower
0
heinrichsweikamp
parents:
diff changeset
1152 WR_L
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1153 WR_H ; tick
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1154 bsf INTCON,GIE
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1155 decfsz PRODL,F ; row loop finished ?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1156 bra TFT_box3 ; NO - continue
0
heinrichsweikamp
parents:
diff changeset
1157
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1158 incf PRODH,F ; column count ++
0
heinrichsweikamp
parents:
diff changeset
1159
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1160 movf win_bargraph,W ; current column == bargraph ?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1161 cpfseq PRODH
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1162 bra TFT_box4 ; NO - just loop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1163 clrf win_color1 ; Yes - switch to black
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1164 clrf win_color2 ; - ...
0
heinrichsweikamp
parents:
diff changeset
1165 TFT_box4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1166 movf win_width+0,W ; compare ?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1167 xorwf PRODH,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1168 bnz TFT_box2 ; Loop not finished
0
heinrichsweikamp
parents:
diff changeset
1169
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1170 movlw 0x00 ; NOP, to stop window mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1171 rcall TFT_CmdWrite
0
heinrichsweikamp
parents:
diff changeset
1172
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1173 ; reset bargraph mode...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1174 setf win_bargraph
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1175 return
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1176 TFT_box_display2:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1177 ;---- Define Window ------------------------------------------------------
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1178 bcf STATUS,C
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1179 rlcf win_width+0,F
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1180 rlcf win_width+1,F ; x2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1181 rcall TFT_box_write ; Setup box
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1182
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1183 bcf STATUS,C
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1184 rrcf win_width+1,F ; width /= 2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1185 rrcf win_width+0,F
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1186
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1187 movff win_color1,PRODH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1188 movff win_color2,PRODL
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1189 rcall convert_for_display2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1190 ;---- Fill Window --------------------------------------------------------
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1191 Index_out 0x22 ; Frame Memory Data Write start
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1192
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1193 clrf PRODH ; Column counter.
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1194 RS_H ; Data
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1195
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1196 TFT_box2_display2: ; Loop height times
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1197 movff win_height,PRODL
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1198
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1199 TFT_box3_display2: ; loop width times
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1200 movff win_color5,PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1201 bcf tft_nwr
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1202 bsf tft_nwr ; Upper
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1203 movff win_color4,PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1204 bcf tft_nwr
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1205 bsf tft_nwr ; High
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1206 movff win_color3,PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1207 bcf tft_nwr
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1208 bsf tft_nwr ; Lower
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1209
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1210 movff win_color5,PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1211 bcf tft_nwr
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1212 bsf tft_nwr ; Upper
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1213 movff win_color4,PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1214 bcf tft_nwr
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1215 bsf tft_nwr ; High
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1216 movff win_color3,PORTH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1217 bcf tft_nwr
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1218 bsf tft_nwr ; Lower
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1219 decfsz PRODL,F ; row loop finished ?
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1220 bra TFT_box3_display2 ; No: continue.
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1221
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1222 incf PRODH,F ; column count ++
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1223
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1224 movf win_bargraph,W ; current column == bargraph ?
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1225 cpfseq PRODH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1226 bra TFT_box4_display2 ; No: just loop.
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1227
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1228 ; Yes: switch to black
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1229 clrf win_color5
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1230 clrf win_color4
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1231 clrf win_color3
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1232 TFT_box4_display2:
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1233 movf win_width+0,W
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1234 cpfseq PRODH
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1235 bra TFT_box2_display2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1236
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1237 ; Reset bargraph mode...
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1238 setf win_bargraph
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1239 return
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1240
0
heinrichsweikamp
parents:
diff changeset
1241
heinrichsweikamp
parents:
diff changeset
1242 ;=============================================================================
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1243 ; Converts 8 bit RGB b'RRRGGGBB' into 16 bit RGB b'RRRRRGGGGGGBBBBB'
0
heinrichsweikamp
parents:
diff changeset
1244
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1245 global TFT_set_color
0
heinrichsweikamp
parents:
diff changeset
1246 TFT_set_color:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1247 movwf tft_temp1 ; get 8 Bit RGB b'RRRGGGBB'
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1248 movwf tft_temp2 ; copy
0
heinrichsweikamp
parents:
diff changeset
1249
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1250 ; mask bit 7,6,5,4,3,2
0
heinrichsweikamp
parents:
diff changeset
1251 movlw b'00000011'
heinrichsweikamp
parents:
diff changeset
1252 andwf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1253
heinrichsweikamp
parents:
diff changeset
1254 movlw b'00000000'
heinrichsweikamp
parents:
diff changeset
1255 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1256 movlw b'01010000'
heinrichsweikamp
parents:
diff changeset
1257 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1258 movlw b'10100000'
heinrichsweikamp
parents:
diff changeset
1259 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1260 movlw b'11111000'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1261 movwf tft_temp3 ; blue done
0
heinrichsweikamp
parents:
diff changeset
1262
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1263 movff tft_temp1,tft_temp2 ; copy
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1264 ; mask bit 7,6,5,1,0
0
heinrichsweikamp
parents:
diff changeset
1265 movlw b'00011100'
heinrichsweikamp
parents:
diff changeset
1266 andwf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1267 rrncf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1268 rrncf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1269
heinrichsweikamp
parents:
diff changeset
1270 movlw b'00000000'
heinrichsweikamp
parents:
diff changeset
1271 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1272 movlw b'00000100'
heinrichsweikamp
parents:
diff changeset
1273 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1274 movlw b'00001000'
heinrichsweikamp
parents:
diff changeset
1275 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1276 movlw b'00001100'
heinrichsweikamp
parents:
diff changeset
1277 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1278 movlw b'00010000'
heinrichsweikamp
parents:
diff changeset
1279 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1280 movlw b'00010100'
heinrichsweikamp
parents:
diff changeset
1281 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1282 movlw b'00100000'
heinrichsweikamp
parents:
diff changeset
1283 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1284 movlw b'00111111'
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1285 movwf tft_temp4
0
heinrichsweikamp
parents:
diff changeset
1286
heinrichsweikamp
parents:
diff changeset
1287 rrcf tft_temp4,F
heinrichsweikamp
parents:
diff changeset
1288 rrcf tft_temp3,F
heinrichsweikamp
parents:
diff changeset
1289
heinrichsweikamp
parents:
diff changeset
1290 rrcf tft_temp4,F
heinrichsweikamp
parents:
diff changeset
1291 rrcf tft_temp3,F
heinrichsweikamp
parents:
diff changeset
1292
heinrichsweikamp
parents:
diff changeset
1293 rrcf tft_temp4,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1294 rrcf tft_temp3,W ; tft_temp3 (b'GGGBBBBB') done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1295 movwf win_color2 ; set color registers...
0
heinrichsweikamp
parents:
diff changeset
1296
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1297 movff tft_temp1,tft_temp2 ; copy
0
heinrichsweikamp
parents:
diff changeset
1298 clrf tft_temp1
heinrichsweikamp
parents:
diff changeset
1299
heinrichsweikamp
parents:
diff changeset
1300 rrcf tft_temp4,F
heinrichsweikamp
parents:
diff changeset
1301 rrcf tft_temp1,F
heinrichsweikamp
parents:
diff changeset
1302
heinrichsweikamp
parents:
diff changeset
1303 rrcf tft_temp4,F
heinrichsweikamp
parents:
diff changeset
1304 rrcf tft_temp1,F
heinrichsweikamp
parents:
diff changeset
1305
heinrichsweikamp
parents:
diff changeset
1306 rrcf tft_temp4,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1307 rrcf tft_temp1,F ; green done
0
heinrichsweikamp
parents:
diff changeset
1308
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1309 ; mask bit 4,3,2,1,0
0
heinrichsweikamp
parents:
diff changeset
1310 movlw b'11100000'
heinrichsweikamp
parents:
diff changeset
1311 andwf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1312
heinrichsweikamp
parents:
diff changeset
1313 rrncf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1314 rrncf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1315 rrncf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1316 rrncf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1317 rrncf tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1318
heinrichsweikamp
parents:
diff changeset
1319 movlw b'00000000'
heinrichsweikamp
parents:
diff changeset
1320 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1321 movlw b'00000100'
heinrichsweikamp
parents:
diff changeset
1322 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1323 movlw b'00001000'
heinrichsweikamp
parents:
diff changeset
1324 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1325 movlw b'00001100'
heinrichsweikamp
parents:
diff changeset
1326 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1327 movlw b'00010000'
heinrichsweikamp
parents:
diff changeset
1328 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1329 movlw b'00010100'
heinrichsweikamp
parents:
diff changeset
1330 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1331 movlw b'00100000'
heinrichsweikamp
parents:
diff changeset
1332 dcfsnz tft_temp2,F
heinrichsweikamp
parents:
diff changeset
1333 movlw b'00111111'
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1334 movwf tft_temp4
0
heinrichsweikamp
parents:
diff changeset
1335
heinrichsweikamp
parents:
diff changeset
1336 rrcf tft_temp4,F
heinrichsweikamp
parents:
diff changeset
1337 rrcf tft_temp1,F
heinrichsweikamp
parents:
diff changeset
1338
heinrichsweikamp
parents:
diff changeset
1339 rrcf tft_temp4,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1340 rrcf tft_temp1,F
0
heinrichsweikamp
parents:
diff changeset
1341
heinrichsweikamp
parents:
diff changeset
1342 rrcf tft_temp4,F
heinrichsweikamp
parents:
diff changeset
1343 rrcf tft_temp1,F
heinrichsweikamp
parents:
diff changeset
1344
heinrichsweikamp
parents:
diff changeset
1345 rrcf tft_temp4,F
heinrichsweikamp
parents:
diff changeset
1346 rrcf tft_temp1,F
heinrichsweikamp
parents:
diff changeset
1347
heinrichsweikamp
parents:
diff changeset
1348 rrcf tft_temp4,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1349 rrcf tft_temp1,W ; red done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1350 movwf win_color1 ; set color registers
0
heinrichsweikamp
parents:
diff changeset
1351 return
608
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1352
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1353 global convert_for_display2
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1354 convert_for_display2: ; Convert 16Bit RGB b'RRRRRGGG GGGBBBBB' into 24Bit RGB b'RRRRRR00 GGGGGG00 BBBBBB00'
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1355 ; PRODH PRODL win_color5 win_color4 win_color3
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1356 ; Red
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1357 movff PRODH,win_color5 ; = RRRRRGGG
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1358 bcf win_color5,2 ; = RRRRR0GG
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1359 btfsc win_color5,7
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1360 bsf win_color5,2 ; = RRRRR1GG ; Lower two bits ignored from screen!
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1361 ; Blue
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1362 movff PRODL,win_color3
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1363 rrcf win_color3,F ; = UGGGBBBB (And the LSB-Blue in Carry)
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1364 swapf win_color3,F ; = BBBBUGGG
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1365 bcf win_color3,3 ; = BBBB0GGG
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1366 btfsc STATUS,C
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1367 bsf win_color3,3 ; = BBBB1GGG
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1368 bcf win_color3,2 ; = BBBBB0GG
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1369 btfsc win_color3,7
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1370 bsf win_color3,2 ; = BBBBB1GG
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1371 ; Green
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1372 rrcf PRODH,F
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1373 rrcf PRODL,F
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1374 rrcf PRODH,F
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1375 rrcf PRODL,F
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1376 rrcf PRODH,F
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1377 rrcf PRODL,F ; = GGGGGGBB ; Lower two bits ignored from screen!
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1378 movff PRODL,win_color4
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1379 return
d866684249bd work on 2.99 stable
heinrichsweikamp
parents: 604
diff changeset
1380
0
heinrichsweikamp
parents:
diff changeset
1381
heinrichsweikamp
parents:
diff changeset
1382 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
1383 ; Dump screen contents to the UART
heinrichsweikamp
parents:
diff changeset
1384
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1385 IFDEF _screendump
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1386
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1387 global TFT_dump_screen_check
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1388 global TFT_dump_screen
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1389 TFT_dump_screen_check:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1390 btfss vusb_in ; USB (still) plugged in?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1391 bcf enable_screen_dumps ; NO - clear flag
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1392 call rs232_get_byte ; try to read data from RS232
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1393 btfsc rs232_receive_overflow ; anything received?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1394 return ; NO - return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1395 movlw "l" ; YES - load coding for screendump command
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1396 cpfseq RCREG1 ; screendump command received?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1397 return ; NO - return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1398 TFT_dump_screen: ; YES
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1399 bsf no_sensor_int
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1400 movlw 'l'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1401 movwf TXREG ; send command echo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1402 call rs232_wait_tx ; wait for UART
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1403
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1404 ;---- 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
1405 Index_out 0x50 ; window horizontal start address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1406 Parameter_out 0x00, 0x00 ; 0-239
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1407 Index_out 0x51 ; window horizontal end address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1408 Parameter_out 0x00, 0xEF ; 0-239
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1409 Index_out 0x52 ; window vertical start address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1410 Parameter_out 0x00, 0x00 ; 0-319
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1411 Index_out 0x53 ; window vertical end address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1412 Parameter_out 0x01, 0x3F ; 0-319
0
heinrichsweikamp
parents:
diff changeset
1413
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1414 clrf ds_column
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1415 rcall dump_screen_pixel_reset
0
heinrichsweikamp
parents:
diff changeset
1416 dump_screen_1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1417 btg LEDr ; LED activity toggle
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1418 ; Dump even column
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1419 movlw .240 ; 240 lines, once
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1420 movwf ds_line
0
heinrichsweikamp
parents:
diff changeset
1421 dump_screen_2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1422 Index_out 0x20 ; frame memory horizontal address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1423 movff ds_line,WREG ; d'0' ... d'239'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1424 mullw .1 ; copy row to PRODH:L
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1425 rcall TFT_DataWrite_PROD
0
heinrichsweikamp
parents:
diff changeset
1426
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1427 movff ds_column,WREG ; Init X position
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1428 mullw 2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1429 rcall pixel_write_col320 ; start address vertical (.0 - .319)
0
heinrichsweikamp
parents:
diff changeset
1430
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1431 rcall TFT_DataRead_PROD ; read pixel
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1432 rcall dump_screen_pixel
0
heinrichsweikamp
parents:
diff changeset
1433
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1434 decfsz ds_line,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1435 bra dump_screen_2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1436 rcall dump_screen_pixel_flush
0
heinrichsweikamp
parents:
diff changeset
1437
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1438 ; Dump odd column
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1439 movlw .240 ; 240 lines, twice
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1440 movwf ds_line
0
heinrichsweikamp
parents:
diff changeset
1441 dump_screen_3:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1442 Index_out 0x20 ; frame memory horizontal address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1443 movff ds_line,WREG ; d'0' ... d'239'
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1444 mullw 1 ; copy row to PRODH:L
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1445 rcall TFT_DataWrite_PROD
0
heinrichsweikamp
parents:
diff changeset
1446
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1447 movff ds_column,WREG ; init X position
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1448 mullw 2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1449 movlw .1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1450 addwf PRODL,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1451 movlw 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1452 addwfc PRODH,F ; +1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1453 rcall pixel_write_col320 ; start address vertical (.0 - .319)
0
heinrichsweikamp
parents:
diff changeset
1454
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1455 rcall TFT_DataRead_PROD ; read pixel
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1456 rcall dump_screen_pixel
0
heinrichsweikamp
parents:
diff changeset
1457
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1458 decfsz ds_line,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1459 bra dump_screen_3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1460 rcall dump_screen_pixel_flush
0
heinrichsweikamp
parents:
diff changeset
1461
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1462 incf ds_column,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1463 movlw .160
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1464 cpfseq ds_column
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1465 bra dump_screen_1
0
heinrichsweikamp
parents:
diff changeset
1466
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1467 bcf no_sensor_int
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1468 clrf RCREG1 ; clear receive buffer
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1469 bcf RCSTA1,CREN ; clear receiver status
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1470 bsf RCSTA1,CREN
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1471 bsf enable_screen_dumps ; =1: Ignore vin_usb, wait for "l" command (screen dump)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1472 return
0
heinrichsweikamp
parents:
diff changeset
1473
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1474 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1475
0
heinrichsweikamp
parents:
diff changeset
1476
heinrichsweikamp
parents:
diff changeset
1477 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
1478 ; Pixel compression
heinrichsweikamp
parents:
diff changeset
1479 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1480 ; Input : PRODH:L = pixel
0
heinrichsweikamp
parents:
diff changeset
1481 ; Output: Compressed stream on output.
heinrichsweikamp
parents:
diff changeset
1482 ; Compressed format:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1483 ; 0ccccccc : BLACK pixel, repeated ccccccc+1 times (1..128)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1484 ; 11cccccc : WHITE pixel, repeated cccccc+1 times (1.. 64)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1485 ; 10cccccc HIGH LOW : color pixel (H:L) repeated ccccc+1 times (1.. 64)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1486
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1487 IFDEF _screendump
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1488
0
heinrichsweikamp
parents:
diff changeset
1489 dump_screen_pixel:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1490 movf PRODH,W ; compare pixel-high
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1491 xorwf ds_pixel+1,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1492 bnz dump_screen_pixel_1 ; different -> dump
0
heinrichsweikamp
parents:
diff changeset
1493
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1494 movf PRODL,W ; compare pixel-low
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1495 xorwf ds_pixel+0,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1496 bnz dump_screen_pixel_1 ; different -> dump
0
heinrichsweikamp
parents:
diff changeset
1497
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1498 incf ds_count,F ; same color: just increment
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1499 return
0
heinrichsweikamp
parents:
diff changeset
1500
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1501 dump_screen_pixel_1: ; send (pixel,count) tuple
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1502 movf ds_count,W ; is count zero ?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1503 bz dump_screen_pixel_2 ; YES - skip sending
0
heinrichsweikamp
parents:
diff changeset
1504
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1505 movf ds_pixel+1,W ; is this a BLACK pixel ?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1506 iorwf ds_pixel+0,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1507 bz dump_screen_pix_black ; YES
0
heinrichsweikamp
parents:
diff changeset
1508
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1509 movf ds_pixel+1,W ; is this a white pixel ?
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1510 andwf ds_pixel+0,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1511 incf WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1512 bz dump_screen_pix_white ; YES
0
heinrichsweikamp
parents:
diff changeset
1513
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1514 ; No: write the pixel itself...
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1515 movlw .64 ; max color pixel on a single byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1516 cpfsgt ds_count ; skip if count > 64
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1517 movf ds_count,W ; W <- min(64,count)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1518 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
1519 decf WREG ; save as 0..63
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1520 iorlw b'10000000' ; mark as a color pixel
0
heinrichsweikamp
parents:
diff changeset
1521
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1522 movwf TXREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1523 call rs232_wait_tx ; wait for UART
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1524 movff ds_pixel+1,TXREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1525 call rs232_wait_tx ; wait for UART
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1526 movff ds_pixel+0,TXREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1527 call rs232_wait_tx ; wait for UART
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1528 bra dump_screen_pixel_1
0
heinrichsweikamp
parents:
diff changeset
1529
heinrichsweikamp
parents:
diff changeset
1530 dump_screen_pixel_2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1531 movff PRODH,ds_pixel+1 ; save new pixel color
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1532 movff PRODL,ds_pixel+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1533 movlw 1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1534 movwf ds_count ; and set count=1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1535 return
0
heinrichsweikamp
parents:
diff changeset
1536
heinrichsweikamp
parents:
diff changeset
1537 dump_screen_pix_black:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1538 movlw .128 ; max black pixel on a single byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1539 cpfsgt ds_count ; skip if count > 128
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1540 movf ds_count,W ; W <- min(128,count)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1541 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
1542 decf WREG ; save as 0..127
0
heinrichsweikamp
parents:
diff changeset
1543 dump_screen_pix_3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1544 movwf TXREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1545 call rs232_wait_tx
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1546 bra dump_screen_pixel_1 ; more to dump ?
0
heinrichsweikamp
parents:
diff changeset
1547
heinrichsweikamp
parents:
diff changeset
1548 dump_screen_pix_white:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1549 movlw .64 ; max white pixel on a single byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1550 cpfsgt ds_count ; skip if count > 64
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1551 movf ds_count,W ; W <- min(64,count)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1552 subwf ds_count,F ; ds_count <- ds_count-W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1553 decf WREG ; Save as 0..63
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1554 iorlw b'11000000' ; mark as a compressed white
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1555 bra dump_screen_pix_3
0
heinrichsweikamp
parents:
diff changeset
1556
heinrichsweikamp
parents:
diff changeset
1557 dump_screen_pixel_flush:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1558 clrf PRODH
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1559 clrf PRODL
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1560 rcall dump_screen_pixel_1 ; send it
0
heinrichsweikamp
parents:
diff changeset
1561 dump_screen_pixel_reset:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1562 clrf ds_count ; clear count
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1563 return
0
heinrichsweikamp
parents:
diff changeset
1564
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1565 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 582
diff changeset
1566
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 461
diff changeset
1567 END