| 1 |
; |
| 2 |
; lcd100X32.asm - Driver for 100X32 pixel graphics LCD based on |
| 3 |
; SED1520 controllers |
| 4 |
; |
| 5 |
; |
| 6 |
; From a high level point of view, this driver supports basic graphing |
| 7 |
; and text functions (that the SED1320 lacks). The graphing functions |
| 8 |
; include points and lines, while the text function allows 5X7 fonts |
| 9 |
; to be written to the display. |
| 10 |
; |
| 11 |
; The driver is relatively inefficient with regards to memory usage. The |
| 12 |
; entire 100X32 LCD display is buffered in the PIC's memory. The purpose |
| 13 |
; of this is to simplify the mapping of the logical coordinates of the LCD |
| 14 |
; display to the RAM embedded in the SED1520's. |
| 15 |
; |
| 16 |
; !!! NOTE: The driver assumes all variables reside in Bank 0!. !!! |
| 17 |
|
| 18 |
include "processor.inc" |
| 19 |
include "sed1520.inc" |
| 20 |
|
| 21 |
|
| 22 |
; GLOBAL DisplayBuffer |
| 23 |
EXTERN DisplayBuffer |
| 24 |
GLOBAL LCD_ClearScreen |
| 25 |
GLOBAL SED1520_Test |
| 26 |
GLOBAL LCD_Line |
| 27 |
GLOBAL LCD_putBitMap |
| 28 |
|
| 29 |
EXTERN temp0, temp1, temp2, temp3 |
| 30 |
|
| 31 |
UDATA_ACS |
| 32 |
|
| 33 |
|
| 34 |
LCD_WritePtrLo RES 1 |
| 35 |
LCD_WritePtrHi RES 1 |
| 36 |
PixelX RES 1 |
| 37 |
PixelY RES 1 |
| 38 |
TempX RES 1 |
| 39 |
TempY RES 1 |
| 40 |
|
| 41 |
global TempY, PixelX, PixelY |
| 42 |
|
| 43 |
|
| 44 |
;---------------------------------------- |
| 45 |
; Private RAM area for temporary variables. |
| 46 |
|
| 47 |
TempRam udata_ovr 0x78 |
| 48 |
LCD_Temporaries RES 6 |
| 49 |
|
| 50 |
|
| 51 |
TempRam udata_ovr 0x78 |
| 52 |
|
| 53 |
LCD_x2 RES 1 |
| 54 |
LCD_y2 RES 1 |
| 55 |
slope RES 1 |
| 56 |
dx RES 1 |
| 57 |
dy RES 1 |
| 58 |
dir RES 1 |
| 59 |
|
| 60 |
global LCD_x2, LCD_y2 |
| 61 |
|
| 62 |
;------------------------------------------------------------------------ |
| 63 |
; Display buffer |
| 64 |
; |
| 65 |
;GPR_ARRAYS UDATA 400 |
| 66 |
;DisplayBuffer RES 100*4 |
| 67 |
|
| 68 |
;------------------------------------------------------------------------ |
| 69 |
; |
| 70 |
|
| 71 |
LCD_CODE CODE |
| 72 |
|
| 73 |
|
| 74 |
SED1520_Test: |
| 75 |
|
| 76 |
TestBitMap: |
| 77 |
|
| 78 |
MOVLW 20 |
| 79 |
MOVWF PixelX |
| 80 |
CLRF PixelY |
| 81 |
|
| 82 |
MOVLW 2 |
| 83 |
RCALL LCD_putBitMap |
| 84 |
|
| 85 |
CLRF PixelX |
| 86 |
CLRF PixelY |
| 87 |
MOVLW 93 |
| 88 |
MOVWF LCD_x2 |
| 89 |
CLRF LCD_y2 |
| 90 |
|
| 91 |
RCALL LCD_Line |
| 92 |
|
| 93 |
MOVLW 31 |
| 94 |
MOVWF LCD_x2 |
| 95 |
MOVWF LCD_y2 |
| 96 |
|
| 97 |
RCALL LCD_Line |
| 98 |
|
| 99 |
CLRF PixelX |
| 100 |
CLRF PixelY |
| 101 |
RCALL LCD_Line |
| 102 |
|
| 103 |
|
| 104 |
bra LCD_RefreshDisplay |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
;------------------------------------------------------------------------ |
| 109 |
;LCD_ClearScreen |
| 110 |
|
| 111 |
LCD_ClearScreen: |
| 112 |
|
| 113 |
LFSR 0, DisplayBuffer ;Get a pointer to the display |
| 114 |
movlw 100 |
| 115 |
movwf temp0 |
| 116 |
movlw 4 |
| 117 |
cs1: |
| 118 |
CLRF POSTINC0 |
| 119 |
decfsz temp0,F |
| 120 |
bra cs1 |
| 121 |
decfsz WREG,F |
| 122 |
bra cs1 |
| 123 |
return |
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
;------------------------------------------------------------------------ |
| 128 |
; LCD_putBitMap |
| 129 |
; |
| 130 |
; Input: x1, y1 - Where the upper left hand corner of the bitmap will be placed |
| 131 |
; WREG - Bitmap # (i.e. index into the BitMapTable array) |
| 132 |
; Output |
| 133 |
; MemUsed: temp0 - used as a counter |
| 134 |
; PRODL,PRODH |
| 135 |
; TBLPTRL,TBLPTRH |
| 136 |
; |
| 137 |
; Calls: LCD_putByte |
| 138 |
|
| 139 |
LCD_putBitMap: |
| 140 |
|
| 141 |
; Point to BitMapTable entry that contains the pointer |
| 142 |
; to the desired bitmap. |
| 143 |
|
| 144 |
RLNCF WREG,W |
| 145 |
ADDLW LOW(BitMapTable) |
| 146 |
MOVWF TBLPTRL |
| 147 |
MOVLW HIGH(BitMapTable) |
| 148 |
SKPNC |
| 149 |
ADDLW 1 |
| 150 |
MOVWF TBLPTRH |
| 151 |
|
| 152 |
; Get the pointer to the bitmap |
| 153 |
|
| 154 |
TBLRD *+ |
| 155 |
MOVF TABLAT,W |
| 156 |
TBLRD *+ |
| 157 |
MOVWF TBLPTRL |
| 158 |
MOVF TABLAT,W |
| 159 |
MOVWF TBLPTRH |
| 160 |
|
| 161 |
; The first byte of the bitmap is the width and the second is the height |
| 162 |
|
| 163 |
TBLRD *+ |
| 164 |
MOVF TABLAT,W |
| 165 |
MOVWF LCD_y2 |
| 166 |
TBLRD *+ |
| 167 |
MOVF TABLAT,W |
| 168 |
MOVWF LCD_x2 |
| 169 |
|
| 170 |
; At this point, the TBLPTR points to the bitmap data. Now we need |
| 171 |
; to fetch this data and copy it to the display. |
| 172 |
|
| 173 |
movf PixelX,W |
| 174 |
movwf temp1 |
| 175 |
rrncf PixelY,W |
| 176 |
rrncf WREG,W |
| 177 |
rrncf WREG,W |
| 178 |
RCALL LCD_MoveCursor |
| 179 |
|
| 180 |
pbm1: |
| 181 |
MOVF LCD_y2,W |
| 182 |
MOVWF temp0 |
| 183 |
pbm2: |
| 184 |
TBLRD *+ |
| 185 |
MOVF TABLAT,W |
| 186 |
RCALL LCD_PutByte |
| 187 |
DECFSZ temp0,F |
| 188 |
bra pbm2 |
| 189 |
|
| 190 |
MOVF LCD_y2,W |
| 191 |
SUBLW 100 |
| 192 |
ADDWF LCD_WritePtrLo,F |
| 193 |
CLRW |
| 194 |
ADDWFC LCD_WritePtrHi,F |
| 195 |
|
| 196 |
DECFSZ LCD_x2,F |
| 197 |
bra pbm1 |
| 198 |
|
| 199 |
aret: RETURN |
| 200 |
;------------------------------------------------------------------------ |
| 201 |
; LCD_putc |
| 202 |
; |
| 203 |
; Write a single character to the LCD display buffer. The input is the ASCII |
| 204 |
; code of the character to write. This is used as an index into the LCD font |
| 205 |
; table. The 5 7-bit bytes that comprise this character are then written to |
| 206 |
; the LCD display buffer. In addition, a 6th byte containing 0 is written so |
| 207 |
; that there will be a little space between characters. Note, the character |
| 208 |
; will be written at the current location of the cursor. No attempt is made |
| 209 |
; to prevent line wrapping. |
| 210 |
; |
| 211 |
; Input: WREG - ASCII value of character |
| 212 |
; Output: None |
| 213 |
; Mem used: temp0 - used as a counter |
| 214 |
; |
| 215 |
LCD_putc: |
| 216 |
|
| 217 |
BTFSC WREG,7 ;The max character is 127 |
| 218 |
return ;leave if we're beyond this. |
| 219 |
|
| 220 |
ADDLW -' ' ;The first character in the table is a Space |
| 221 |
BNC aret ;leave if the ascii code is smaller than this |
| 222 |
|
| 223 |
MULLW 5 ;Each character is comprised of 5 bytes. |
| 224 |
;The offset into the table is the product |
| 225 |
;of the ASCII code and the size of each character |
| 226 |
CLRF TBLPTRU ;Get a pointer to the |
| 227 |
MOVF PRODL,W ;start of this character's font |
| 228 |
ADDLW LOW(ASCII_5X7Table) ; |
| 229 |
MOVWF TBLPTRL ; |
| 230 |
|
| 231 |
MOVLW HIGH(ASCII_5X7Table) ; |
| 232 |
ADDWFC PRODH,W |
| 233 |
MOVWF TBLPTRH ; |
| 234 |
; |
| 235 |
MOVLW 5 ; Now loop through and get all 5 bytes |
| 236 |
MOVWF temp0 |
| 237 |
LCD_ASCII_L1 |
| 238 |
TBLRD *+ ;Get one byte |
| 239 |
MOVF TABLAT,W ; |
| 240 |
rcall LCD_PutByte ;Write the byte to the display buffer |
| 241 |
decfsz temp0,F |
| 242 |
bra LCD_ASCII_L1 |
| 243 |
|
| 244 |
MOVLW 0 |
| 245 |
|
| 246 |
;; |
| 247 |
;; !!!! Intentionally fall through to write a zero to the display |
| 248 |
;; |
| 249 |
|
| 250 |
;------------------------------------------------------------------------ |
| 251 |
; LCD_PutByte - write a byte of data to the LCD display buffer |
| 252 |
; |
| 253 |
; Write the byte contained in W to the display buffer. The byte is written |
| 254 |
; at the current cursor position. Also, the cursor position is incremented |
| 255 |
; after the write. |
| 256 |
; |
| 257 |
; INPUT: WREG |
| 258 |
; OUTPUT: |
| 259 |
; Mem Used: temp1 |
| 260 |
; LCD_WritePtrLo/Hi |
| 261 |
; FSR0L/H |
| 262 |
|
| 263 |
LCD_PutByte: |
| 264 |
|
| 265 |
MOVWF temp1 ;Save the byte to write |
| 266 |
|
| 267 |
LFSR 0, DisplayBuffer ;Get a pointer to the display |
| 268 |
MOVF LCD_WritePtrLo,W ;Now point to the location |
| 269 |
ADDWF FSR0L,F ;of the cursor. |
| 270 |
MOVF LCD_WritePtrHi,W |
| 271 |
ADDWFC FSR0H,F |
| 272 |
|
| 273 |
MOVFF temp1, INDF0 ;Write the byte to the display |
| 274 |
|
| 275 |
INFSNZ LCD_WritePtrLo,F ;Increment the cursor position |
| 276 |
INCF LCD_WritePtrHi,F |
| 277 |
|
| 278 |
MOVLW LOW(400) ;The Display buffer is only 400 |
| 279 |
CPFSLT LCD_WritePtrLo ;bytes. If we didn't increment |
| 280 |
BTFSS LCD_WritePtrHi,0 ;beyond the end of the display |
| 281 |
return ;then we're okay. |
| 282 |
|
| 283 |
CLRF LCD_WritePtrHi ;oops - we've rolled over |
| 284 |
CLRF LCD_WritePtrLo |
| 285 |
return |
| 286 |
|
| 287 |
;------------------------------------------------------------------------ |
| 288 |
; LCD_MoveCursor - re-position the cursor. The cursor marks where the next |
| 289 |
; byte will be written |
| 290 |
; |
| 291 |
; INPUT: WREG - row |
| 292 |
; temp1 - column |
| 293 |
; OUTPUT |
| 294 |
; MemUsed: LCD_WritePtrLo/HI |
| 295 |
; PRODL/H |
| 296 |
|
| 297 |
LCD_MoveCursor: |
| 298 |
ANDLW 3 |
| 299 |
MULLW 100 |
| 300 |
MOVF PRODL,W |
| 301 |
MOVWF LCD_WritePtrLo |
| 302 |
MOVF PRODH,W |
| 303 |
MOVWF LCD_WritePtrHi |
| 304 |
|
| 305 |
MOVF temp1,W |
| 306 |
ADDWF LCD_WritePtrLo,F |
| 307 |
CLRW |
| 308 |
ADDWFC LCD_WritePtrHi,F |
| 309 |
RETURN |
| 310 |
|
| 311 |
;------------------------------------------------------------------------ |
| 312 |
; LCD_GetPixelPtr - convert the current (PixelX,PixelY) coordinates into |
| 313 |
; a pointer into the display buffer. This pointer is returned in FSR0 |
| 314 |
; and the bit offset within the byte of the display buffer is returned |
| 315 |
; is returned as bit mask in temp0. |
| 316 |
; |
| 317 |
; { |
| 318 |
; temp0 = 1<<(PixelY & 7); |
| 319 |
; |
| 320 |
; int offset = (PixelY>>3) * nLCD_COLUMNS + PixelX |
| 321 |
; FSR0 = &DisplayBuffer[offset]; |
| 322 |
; return(temp0); |
| 323 |
; } |
| 324 |
; |
| 325 |
; Input: PixelX = X location of the pixel |
| 326 |
; PixelY = Y location of the pixel |
| 327 |
; Output: FSR0L:FSR0H -- will point to the byte offset in the display buffer |
| 328 |
; temp0 -- 2^n where n is the position within the byte. |
| 329 |
; |
| 330 |
|
| 331 |
LCD_GetPixelPtr: |
| 332 |
RRCF PixelY,W ;Put the LSB of the current Y pixel into C. |
| 333 |
|
| 334 |
CLRF temp0 ; |
| 335 |
BSF temp0,0 ; 1<<0 -- assumes Y is even |
| 336 |
SKPNC ; |
| 337 |
RLNCF temp0,F ; 1<<1 -- Y is actually odd |
| 338 |
|
| 339 |
RRCF WREG,W ;Put bit 1 of the current Y pixel into C |
| 340 |
BNC pp1 ; |
| 341 |
RLNCF temp0,F ; bit 1 is set, so we need to shift the |
| 342 |
RLNCF temp0,F ; mask two positions |
| 343 |
|
| 344 |
pp1: RRCF WREG,W ;Put bit 2 of the current Y pixel into C |
| 345 |
SKPNC ;If it is set |
| 346 |
SWAPF temp0,F ; then shift the mask left 4 positions. |
| 347 |
|
| 348 |
ANDLW 3 ;The lower two bits of W are the 3rd and 4th |
| 349 |
;bit of the current Y pixel. |
| 350 |
MULLW 100 ;Multiply by 100 (number of columns in a row) |
| 351 |
;to obtain the byte offset into the buffer. |
| 352 |
|
| 353 |
LFSR 0, DisplayBuffer ;Get a pointer to the display |
| 354 |
MOVF PRODL,W |
| 355 |
ADDWF FSR0L,F |
| 356 |
MOVF PRODH,W |
| 357 |
ADDWFC FSR0H,F |
| 358 |
|
| 359 |
MOVF PixelX,W |
| 360 |
ADDWF FSR0L,F |
| 361 |
MOVLW 0 |
| 362 |
ADDWFC FSR0H,F |
| 363 |
ret1: |
| 364 |
return |
| 365 |
|
| 366 |
;------------------------------------------------------------------------ |
| 367 |
; LCD_Line - Draw a line |
| 368 |
; |
| 369 |
; Inputs: PixelX, PixelY - start coordinates |
| 370 |
; LCD_x2, LCD_y2 - end coordinates |
| 371 |
; |
| 372 |
; int dx = abs(x2-x1); |
| 373 |
; int dy = abs(y2-y1); |
| 374 |
; |
| 375 |
; int bRight = 1; |
| 376 |
; int bUp = 1; |
| 377 |
; |
| 378 |
; if (dx<0) { |
| 379 |
; bRight = 0; |
| 380 |
; dx = -dx; |
| 381 |
; } |
| 382 |
; if (dy<0) { |
| 383 |
; bUp = 0 ; |
| 384 |
; dy = -dY; |
| 385 |
; } |
| 386 |
; |
| 387 |
; int slope = dx - dy; |
| 388 |
; |
| 389 |
; do { |
| 390 |
; |
| 391 |
; SetPixel(x,y); |
| 392 |
; |
| 393 |
; if ( slope < 0) { |
| 394 |
; y++; |
| 395 |
; slope += dx; |
| 396 |
; } else { |
| 397 |
; x++; |
| 398 |
; slope -= dy; |
| 399 |
; } |
| 400 |
; } while (x!=x2 && y!=y2); |
| 401 |
; |
| 402 |
; |
| 403 |
; MEM Used: |
| 404 |
; dx |
| 405 |
; dy |
| 406 |
; slope |
| 407 |
; temp1 |
| 408 |
; Calls: |
| 409 |
; LCD_SetPixel |
| 410 |
; |
| 411 |
LCD_Line: |
| 412 |
|
| 413 |
|
| 414 |
MOVF PixelX,W ;x1 |
| 415 |
SUBWF LCD_x2,W ;W=x2-x1 |
| 416 |
MOVWF dx ;dx=x2-x1 |
| 417 |
RLCF dir,F ;Pick up carry |
| 418 |
BTFSS dir,0 ;if x2<x1 |
| 419 |
NEGF dx ; dx = x1-x2 |
| 420 |
|
| 421 |
MOVF PixelY,W ;y1 |
| 422 |
SUBWF LCD_y2,W ;W=y2-y1 |
| 423 |
MOVWF dy ;dy=y2-y1 |
| 424 |
RLCF dir,F ;Pick up carry |
| 425 |
BTFSS dir,0 ;if y2<y1 |
| 426 |
NEGF dy ; dy = y1-y2 |
| 427 |
|
| 428 |
; Initialize the slope accumulator to |
| 429 |
; slope = (dx-dy)/2 |
| 430 |
movf dy,W |
| 431 |
subwf dx,w |
| 432 |
rrcf WREG,F |
| 433 |
xorlw 0x80 |
| 434 |
movwf slope |
| 435 |
|
| 436 |
|
| 437 |
btfsc slope,7 |
| 438 |
bra LVertical |
| 439 |
LHorizontal: |
| 440 |
RCALL LCD_SetPixel ;Turn on (PixelX,PixelY) |
| 441 |
|
| 442 |
movf PixelX,W |
| 443 |
xorwf LCD_x2,W |
| 444 |
bz aret |
| 445 |
tstfsz slope |
| 446 |
btfsc slope,7 |
| 447 |
rcall LVertStep |
| 448 |
rcall LHoriStep |
| 449 |
bra LHorizontal |
| 450 |
|
| 451 |
LVertical: |
| 452 |
RCALL LCD_SetPixel ;Turn on (PixelX,PixelY) |
| 453 |
rcall LCD_RefreshDisplay |
| 454 |
movf PixelY,W |
| 455 |
xorwf LCD_y2,W |
| 456 |
bz aret |
| 457 |
btfss slope,7 |
| 458 |
rcall LHoriStep |
| 459 |
rcall LVertStep |
| 460 |
bra LVertical |
| 461 |
|
| 462 |
|
| 463 |
LHoriStep: |
| 464 |
movf dy,W |
| 465 |
subwf slope,F |
| 466 |
btfsc dir,1 |
| 467 |
incf PixelX,F |
| 468 |
btfss dir,1 |
| 469 |
decf PixelX,F |
| 470 |
return |
| 471 |
|
| 472 |
LVertStep: |
| 473 |
movf dx,W |
| 474 |
addwf slope,F |
| 475 |
btfsc dir,0 |
| 476 |
incf PixelY,F |
| 477 |
btfss dir,0 |
| 478 |
decf PixelY,F |
| 479 |
return |
| 480 |
|
| 481 |
|
| 482 |
; |
| 483 |
|
| 484 |
if 0 |
| 485 |
LineLoop: |
| 486 |
RCALL LCD_SetPixel ;Turn on (PixelX,PixelY) |
| 487 |
|
| 488 |
; rcall LCD_RefreshDisplay |
| 489 |
|
| 490 |
btfsc slope,7 ;If the slope accumulator is negative |
| 491 |
bra LVertStep ; then we're taking a vertical step |
| 492 |
|
| 493 |
movf dy,W ;Assume we're taking a horizontal step |
| 494 |
|
| 495 |
TSTFSZ slope ;If the slope accumulator is not zero |
| 496 |
bra LHoriStep ;Then the assumption is correct. |
| 497 |
|
| 498 |
; The slope accumulator is zero. If dx==dy too then that |
| 499 |
; means we're drawing a diagonal line. |
| 500 |
|
| 501 |
cpfseq dx ;if dx!=dy |
| 502 |
bra LnotDiag ;Then we're not drawing a diagonal line. |
| 503 |
|
| 504 |
LineDiag: |
| 505 |
rcall LHorizontal |
| 506 |
rcall LVertical |
| 507 |
bra LineLoop |
| 508 |
LnotDiag: |
| 509 |
cpfsgt dx |
| 510 |
bra LVertStep |
| 511 |
|
| 512 |
LHoriStep: |
| 513 |
rcall LHorizontal ;Advance one step horizontally |
| 514 |
btfsc slope,7 ;If the slope accumulator changed signs |
| 515 |
rcall LVertical ; Then advance one step vertically |
| 516 |
bra LineLoop ; |
| 517 |
|
| 518 |
; LHorizontal subroutine |
| 519 |
; Input: W=dy |
| 520 |
; Output: PixelX is either incremented or decremented |
| 521 |
; slope accumulator is reduced by dy. |
| 522 |
; If Pixel exceeds x2, then the line routine is aborted. |
| 523 |
LHorizontal: |
| 524 |
subwf slope,F |
| 525 |
btfss dir,1 |
| 526 |
bra LHoriLeftStep |
| 527 |
LHoriRightStep: |
| 528 |
incf PixelX,F |
| 529 |
movf PixelX,W |
| 530 |
cpfslt LCD_x2 |
| 531 |
return |
| 532 |
decf PixelX,F |
| 533 |
pop |
| 534 |
return |
| 535 |
LHoriLeftStep |
| 536 |
decf PixelX,W |
| 537 |
bnc LLine1 |
| 538 |
movwf PixelX |
| 539 |
cpfsgt LCD_x2 |
| 540 |
return |
| 541 |
incf PixelX,F |
| 542 |
pop |
| 543 |
return |
| 544 |
|
| 545 |
|
| 546 |
|
| 547 |
LVertStep: |
| 548 |
rcall LVertical |
| 549 |
movf dy,W |
| 550 |
btfss slope,7 |
| 551 |
rcall LHorizontal |
| 552 |
bra LineLoop |
| 553 |
LVertical: |
| 554 |
movf dx,W |
| 555 |
addwf slope,F |
| 556 |
|
| 557 |
btfss dir,0 |
| 558 |
bra LVertDownStep |
| 559 |
LVertUpStep: |
| 560 |
incf PixelY,F |
| 561 |
movf PixelY,W |
| 562 |
cpfslt LCD_y2 |
| 563 |
return |
| 564 |
decf PixelY,F |
| 565 |
pop |
| 566 |
return |
| 567 |
LVertDownStep |
| 568 |
decf PixelY,W |
| 569 |
bnc LLine1 |
| 570 |
movwf PixelY |
| 571 |
cpfsgt LCD_y2 |
| 572 |
return |
| 573 |
incf PixelY,F |
| 574 |
LLine1: pop |
| 575 |
return |
| 576 |
|
| 577 |
endif |
| 578 |
;------------------------------------------------------------------------ |
| 579 |
; LCD_SetPixel - turn on a single Pixel |
| 580 |
; |
| 581 |
; Inputs: |
| 582 |
; PixelX - X coordinate |
| 583 |
; PixelY - Y coordinate |
| 584 |
; |
| 585 |
; Outputs |
| 586 |
; Mem Used: |
| 587 |
; temp0 |
| 588 |
; Calls |
| 589 |
; LCD_GetPixelPtr |
| 590 |
LCD_SetPixel: |
| 591 |
RCALL LCD_GetPixelPtr |
| 592 |
MOVF temp0,W |
| 593 |
IORWF INDF0,F |
| 594 |
return |
| 595 |
|
| 596 |
;------------------------------------------------------------------------ |
| 597 |
; LCD_ClearPixel - turn off a single Pixel |
| 598 |
|
| 599 |
LCD_ClearPixel: |
| 600 |
RCALL LCD_GetPixelPtr |
| 601 |
COMF temp0,W |
| 602 |
ANDWF INDF0,F |
| 603 |
return |
| 604 |
|
| 605 |
;======================================================================== |
| 606 |
LCD_TABLES CODE 0x3000 |
| 607 |
|
| 608 |
;------------------------------------------------------------------------ |
| 609 |
; This ASCII table contains the 5X7 font for characters 32-127. It was |
| 610 |
; created from a modified version of the perl script that is distributed |
| 611 |
; with gpsim's LCD module. |
| 612 |
ASCII_5X7Table: |
| 613 |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00 ; 32, 33 |
| 614 |
db 0x00, 0x07, 0x00, 0x07, 0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14 ; 34, 35 |
| 615 |
db 0x24, 0x2a, 0x7f, 0x2a, 0x12, 0x23, 0x13, 0x08, 0x64, 0x62 ; 36, 37 |
| 616 |
db 0x36, 0x49, 0x55, 0x22, 0x50, 0x00, 0x05, 0x03, 0x00, 0x00 ; 38, 39 |
| 617 |
db 0x00, 0x1c, 0x22, 0x41, 0x00, 0x00, 0x41, 0x22, 0x1c, 0x00 ; 40, 41 |
| 618 |
db 0x14, 0x08, 0x3e, 0x08, 0x14, 0x08, 0x08, 0x3e, 0x08, 0x08 ; 42, 43 |
| 619 |
db 0x00, 0x50, 0x30, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08 ; 44, 45 |
| 620 |
db 0x00, 0x60, 0x60, 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x02 ; 46, 47 |
| 621 |
db 0x3e, 0x51, 0x49, 0x45, 0x3e, 0x00, 0x42, 0x7f, 0x40, 0x00 ; 48, 49 |
| 622 |
db 0x42, 0x61, 0x51, 0x49, 0x46, 0x21, 0x41, 0x45, 0x4b, 0x31 ; 50, 51 |
| 623 |
db 0x18, 0x14, 0x12, 0x7f, 0x10, 0x27, 0x45, 0x45, 0x45, 0x39 ; 52, 53 |
| 624 |
db 0x3c, 0x4a, 0x49, 0x49, 0x30, 0x01, 0x71, 0x09, 0x05, 0x03 ; 54, 55 |
| 625 |
db 0x36, 0x49, 0x49, 0x49, 0x36, 0x06, 0x49, 0x49, 0x29, 0x1e ; 56, 57 |
| 626 |
db 0x00, 0x36, 0x36, 0x00, 0x00, 0x00, 0x56, 0x36, 0x00, 0x00 ; 58, 59 |
| 627 |
db 0x08, 0x14, 0x22, 0x41, 0x00, 0x14, 0x14, 0x14, 0x14, 0x14 ; 60, 61 |
| 628 |
db 0x41, 0x22, 0x14, 0x08, 0x00, 0x02, 0x01, 0x51, 0x09, 0x06 ; 62, 63 |
| 629 |
db 0x32, 0x49, 0x79, 0x41, 0x3e, 0x7e, 0x11, 0x11, 0x11, 0x7e ; 64, 65 |
| 630 |
db 0x7f, 0x49, 0x49, 0x49, 0x36, 0x3e, 0x41, 0x41, 0x41, 0x22 ; 66, 67 |
| 631 |
db 0x7f, 0x41, 0x41, 0x41, 0x3e, 0x7f, 0x49, 0x49, 0x49, 0x41 ; 68, 69 |
| 632 |
db 0x7f, 0x09, 0x09, 0x09, 0x01, 0x3e, 0x41, 0x49, 0x49, 0x7a ; 70, 71 |
| 633 |
db 0x7f, 0x08, 0x08, 0x08, 0x7f, 0x00, 0x41, 0x7f, 0x41, 0x00 ; 72, 73 |
| 634 |
db 0x20, 0x40, 0x41, 0x3f, 0x01, 0x7f, 0x08, 0x14, 0x22, 0x41 ; 74, 75 |
| 635 |
db 0x7f, 0x40, 0x40, 0x40, 0x40, 0x7f, 0x01, 0x02, 0x01, 0x7f ; 76, 77 |
| 636 |
db 0x7f, 0x04, 0x08, 0x10, 0x7f, 0x3e, 0x41, 0x41, 0x41, 0x3e ; 78, 79 |
| 637 |
db 0x7f, 0x09, 0x09, 0x09, 0x06, 0x3e, 0x41, 0x51, 0x21, 0x5e ; 80, 81 |
| 638 |
db 0x7f, 0x09, 0x19, 0x29, 0x46, 0x46, 0x49, 0x49, 0x49, 0x31 ; 82, 83 |
| 639 |
db 0x01, 0x01, 0x7f, 0x01, 0x01, 0x3f, 0x40, 0x40, 0x40, 0x3f ; 84, 85 |
| 640 |
db 0x1f, 0x20, 0x40, 0x20, 0x1f, 0x3f, 0x40, 0x38, 0x40, 0x3f ; 86, 87 |
| 641 |
db 0x63, 0x14, 0x08, 0x14, 0x63, 0x07, 0x08, 0x70, 0x08, 0x07 ; 88, 89 |
| 642 |
db 0x61, 0x51, 0x49, 0x45, 0x43, 0x00, 0x7f, 0x41, 0x41, 0x00 ; 90, 91 |
| 643 |
db 0x15, 0x16, 0x7c, 0x16, 0x15, 0x00, 0x41, 0x41, 0x7f, 0x00 ; 92, 93 |
| 644 |
db 0x04, 0x02, 0x01, 0x02, 0x04, 0x40, 0x40, 0x40, 0x40, 0x40 ; 94, 95 |
| 645 |
db 0x00, 0x01, 0x02, 0x04, 0x00, 0x20, 0x54, 0x54, 0x54, 0x78 ; 96, 97 |
| 646 |
db 0x7f, 0x48, 0x44, 0x44, 0x38, 0x38, 0x44, 0x44, 0x44, 0x20 ; 98, 99 |
| 647 |
db 0x38, 0x44, 0x44, 0x48, 0x7f, 0x38, 0x54, 0x54, 0x54, 0x18 ; 100, 101 |
| 648 |
db 0x08, 0x7e, 0x09, 0x01, 0x02, 0x06, 0x49, 0x49, 0x49, 0x3f ; 102, 103 |
| 649 |
db 0x7f, 0x08, 0x04, 0x04, 0x78, 0x00, 0x44, 0x7d, 0x40, 0x00 ; 104, 105 |
| 650 |
db 0x20, 0x40, 0x42, 0x3f, 0x00, 0x7f, 0x10, 0x28, 0x44, 0x00 ; 106, 107 |
| 651 |
db 0x00, 0x41, 0x7f, 0x40, 0x00, 0x7c, 0x04, 0x18, 0x04, 0x78 ; 108, 109 |
| 652 |
db 0x7c, 0x08, 0x04, 0x04, 0x78, 0x38, 0x44, 0x44, 0x44, 0x38 ; 110, 111 |
| 653 |
db 0x7c, 0x14, 0x14, 0x14, 0x08, 0x08, 0x14, 0x14, 0x18, 0x7c ; 112, 113 |
| 654 |
db 0x7c, 0x08, 0x04, 0x04, 0x08, 0x48, 0x54, 0x54, 0x54, 0x24 ; 114, 115 |
| 655 |
db 0x02, 0x3f, 0x42, 0x40, 0x20, 0x3c, 0x40, 0x40, 0x20, 0x7c ; 116, 117 |
| 656 |
db 0x1c, 0x20, 0x40, 0x20, 0x1c, 0x3c, 0x40, 0x30, 0x40, 0x3c ; 118, 119 |
| 657 |
db 0x44, 0x28, 0x10, 0x28, 0x44, 0x0c, 0x50, 0x50, 0x50, 0x3c ; 120, 121 |
| 658 |
db 0x44, 0x64, 0x54, 0x4c, 0x44, 0x00, 0x08, 0x36, 0x41, 0x00 ; 122, 123 |
| 659 |
db 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x41, 0x36, 0x08, 0x00 ; 124, 125 |
| 660 |
db 0x08, 0x08, 0x2a, 0x1c, 0x08, 0x08, 0x1c, 0x2a, 0x08, 0x08 ; 126, 127 |
| 661 |
|
| 662 |
|
| 663 |
; Include the bitmaps. |
| 664 |
|
| 665 |
include "bitmaps.asm" |
| 666 |
|
| 667 |
end |