kbd: make kbdGetC blocking

I forgot to update this when changing stdio GetC API.
This commit is contained in:
Virgil Dupras 2019-12-06 17:05:26 -05:00
parent 08392fee60
commit 3a68807cd4

View File

@ -65,7 +65,7 @@ kbdGetC:
ld a, (hl) ld a, (hl)
pop hl ; <-- lvl 1 pop hl ; <-- lvl 1
or a or a
jp z, unsetZ ; no code. Keep A at 0, but unset Z jr z, kbdGetC ; no code. Keep A at 0, but unset Z
; We have something! ; We have something!
cp a ; ensure Z cp a ; ensure Z
ret ret
@ -85,7 +85,7 @@ kbdGetC:
; A scan code over 0x80 is out of bounds or prev KC tell us we should ; A scan code over 0x80 is out of bounds or prev KC tell us we should
; skip. Ignore. ; skip. Ignore.
xor a xor a
jp unsetZ jr kbdGetC
.nothing: .nothing:
; We have nothing. Before we go further, we'll wait a bit to give our ; We have nothing. Before we go further, we'll wait a bit to give our
; device the time to "breathe". When we're in a "nothing" loop, the z80 ; device the time to "breathe". When we're in a "nothing" loop, the z80
@ -97,7 +97,7 @@ kbdGetC:
nop nop
djnz .wait djnz .wait
pop bc pop bc
jp unsetZ jr kbdGetC
; Whether KC in A is L or R shift ; Whether KC in A is L or R shift
.isShift: .isShift:
cp KBD_KC_LSHIFT cp KBD_KC_LSHIFT