mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-25 05:38:05 +11:00
sms/vdp: handle CR and LF
This commit is contained in:
parent
767db17252
commit
404dbd0ddd
@ -79,6 +79,11 @@ vdpPutC:
|
||||
; First, let's place our cursor. We need to first send our LSB, whose
|
||||
; 6 low bits contain our row*2 (each tile is 2 bytes wide) and high
|
||||
; 2 bits are the two low bits of our line
|
||||
; special case: line feed, carriage return
|
||||
cp ASCII_LF
|
||||
jr z, vdpLF
|
||||
cp ASCII_CR
|
||||
jr z, vdpCR
|
||||
; ... but first, let's convert it.
|
||||
call vdpConv
|
||||
; ... and store it away
|
||||
@ -121,8 +126,19 @@ vdpPutC:
|
||||
ret
|
||||
.incline:
|
||||
; increase line and start anew
|
||||
ex af, af' ; bring back orig A
|
||||
call vdpCR
|
||||
jr vdpLF
|
||||
|
||||
vdpCR:
|
||||
push af
|
||||
xor a
|
||||
ld (VDP_ROW), a
|
||||
pop af
|
||||
ret
|
||||
|
||||
vdpLF:
|
||||
push af
|
||||
ld a, (VDP_LINE)
|
||||
inc a
|
||||
cp 24
|
||||
@ -131,7 +147,7 @@ vdpPutC:
|
||||
xor a
|
||||
.norollover:
|
||||
ld (VDP_LINE), a
|
||||
ex af, af' ; bring back orig A
|
||||
pop af
|
||||
ret
|
||||
|
||||
; Convert ASCII char in A into a tile index corresponding to that character.
|
||||
|
Loading…
Reference in New Issue
Block a user