1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-25 05:28:06 +11:00

ti/lcd: add support for backspace

Also, fix visual glitch on line wrap.
This commit is contained in:
Virgil Dupras 2019-11-09 14:37:52 -05:00
parent a4190f9984
commit 6d9f96aee6

View File

@ -153,13 +153,6 @@ lcdSendGlyph:
ld a, (LCD_CURCOL)
call lcdSetCol
; let's increase (and wrap) col now
inc a
ld (LCD_CURCOL), a
cp 16
jr nz, .skip
call lcdLinefeed
.skip:
ld b, FNT_HEIGHT
.loop:
ld a, (hl)
@ -167,6 +160,14 @@ lcdSendGlyph:
call lcdData
djnz .loop
; Increase column and wrap if necessary
ld a, (LCD_CURCOL)
inc a
ld (LCD_CURCOL), a
cp 16
jr nz, .skip
call lcdLinefeed
.skip:
pop hl
pop bc
pop af
@ -240,6 +241,8 @@ lcdClrScr:
lcdPutC:
cp ASCII_LF
jp z, lcdLinefeed
cp ASCII_BS
jr z, .bs
push hl
call fntGet
jr nz, .end
@ -247,3 +250,11 @@ lcdPutC:
.end:
pop hl
ret
.bs:
ld a, (LCD_CURCOL)
or a
ret z ; going back one line is too complicated.
; not implemented yet
dec a
ld (LCD_CURCOL), a
ret