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