From 3ef964e74d6ac990eef6cf3747ce5a3a4d63a5a8 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 4 Nov 2019 14:44:43 -0500 Subject: [PATCH] acia: make GetC blocking --- kernel/acia.asm | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/kernel/acia.asm b/kernel/acia.asm index 2cede2f..fe66274 100644 --- a/kernel/acia.asm +++ b/kernel/acia.asm @@ -98,17 +98,17 @@ aciaInt: reti -; *** BLOCKDEV *** -; These function below follow the blockdev API. +; *** STDIO *** +; These function below follow the stdio API. aciaGetC: push de - +.loop: ld a, (ACIA_BUFWRIDX) ld e, a ld a, (ACIA_BUFRDIDX) cp e - jr z, .nothingToRead ; equal? nothing to read. + jr z, .loop ; equal? nothing to read. loop ; Alrighty, buffer not empty. let's read. ld de, ACIA_BUF @@ -120,12 +120,6 @@ aciaGetC: ; And finally, fetch the value. ld a, (de) - cp a ; ensure Z - jr .end - -.nothingToRead: - call unsetZ -.end: pop de ret