mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-30 20:38:05 +11:00
acia: make GetC blocking
This commit is contained in:
parent
f395297874
commit
3ef964e74d
@ -98,17 +98,17 @@ aciaInt:
|
|||||||
reti
|
reti
|
||||||
|
|
||||||
|
|
||||||
; *** BLOCKDEV ***
|
; *** STDIO ***
|
||||||
; These function below follow the blockdev API.
|
; These function below follow the stdio API.
|
||||||
|
|
||||||
aciaGetC:
|
aciaGetC:
|
||||||
push de
|
push de
|
||||||
|
.loop:
|
||||||
ld a, (ACIA_BUFWRIDX)
|
ld a, (ACIA_BUFWRIDX)
|
||||||
ld e, a
|
ld e, a
|
||||||
ld a, (ACIA_BUFRDIDX)
|
ld a, (ACIA_BUFRDIDX)
|
||||||
cp e
|
cp e
|
||||||
jr z, .nothingToRead ; equal? nothing to read.
|
jr z, .loop ; equal? nothing to read. loop
|
||||||
|
|
||||||
; Alrighty, buffer not empty. let's read.
|
; Alrighty, buffer not empty. let's read.
|
||||||
ld de, ACIA_BUF
|
ld de, ACIA_BUF
|
||||||
@ -120,12 +120,6 @@ aciaGetC:
|
|||||||
|
|
||||||
; And finally, fetch the value.
|
; And finally, fetch the value.
|
||||||
ld a, (de)
|
ld a, (de)
|
||||||
cp a ; ensure Z
|
|
||||||
jr .end
|
|
||||||
|
|
||||||
.nothingToRead:
|
|
||||||
call unsetZ
|
|
||||||
.end:
|
|
||||||
pop de
|
pop de
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user