Plot call SetLCDAddress
clrf Mask
movfw YPos
andlw 0x07
movwf Count
bsf STATUS,C
GetBit rlf Mask,F
decf Count,F
btfss Count,7
goto GetBit
call ReadData ;dummy read
call ReadData
iorwf Mask,F
movfw XPos
andlw 0x3f
iorlw 0x40
call WriteCMD
movfw Mask
call WriteData
return
SetLCDAddress bcf b_LCD_CS1
bcf b_LCD_CS2
btfss XPos,6
bsf b_LCD_CS1
btfsc XPos,6
bsf b_LCD_CS2
movfw XPos
andlw 0x3f
iorlw 0x40
call WriteCMD
movfw YPos
movwf Row
rrf Row,F
rrf Row,F
rrf Row,F
movfw Row
andlw 0x7
iorlw 0xb8
goto WriteCMD
Point call SetLCDAddress
clrf Mask
movfw YPos
andlw 0x07
movwf Count
bsf STATUS,C
PntGetBit rlf Mask,F
decf Count,F
btfss Count,7
goto PntGetBit
call ReadDummy ;dummy read
call ReadData
andwf Mask,W
return
UnPlot call SetLCDAddress
movlw 0xff
movwf Mask
movfw YPos
andlw 0x07
movwf Count
bcf STATUS,C
UnGetBit rlf Mask,F
decf Count,F
btfss Count,7
goto UnGetBit
call ReadDummy ;dummy read
call ReadData
andwf Mask,F
movfw XPos
andlw 0x3f
iorlw 0x40
call WriteCMD
movfw Mask
call WriteData
return
Cls bsf b_LCD_CS1
bsf b_LCD_CS2
movlw 0x08
movwf ForI
ClsLoopI movlw 0x40
movwf ForJ
call WriteCMD
decf ForI,W
iorlw 0xb8
call WriteCMD
ClsLoopK movlw 0x00
call WriteData
decfsz ForJ,F
goto ClsLoopK
decfsz ForI,F
goto ClsLoopI
clrf XPos
clrf YPos
return