aboutsummaryrefslogtreecommitdiffstats
path: root/src/net.asm
diff options
context:
space:
mode:
Diffstat (limited to 'src/net.asm')
-rw-r--r--src/net.asm22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/net.asm b/src/net.asm
index 939b975..f2c4279 100644
--- a/src/net.asm
+++ b/src/net.asm
@@ -39,3 +39,25 @@ sys_srecv::
.got
ld a, [rSB]
ret
+
+; sys_srecv_nb() -> A = byte, CF set if none available (non-blocking).
+sys_srecv_nb::
+ ld a, $80
+ ld [rSC], a
+ ld a, [rSC]
+ bit 7, a
+ jr z, .got
+ scf
+ ret
+.got
+ ld a, [rSB]
+ and a ; CF = 0 (got a byte)
+ ret
+
+; sys_pollin() -> A = char typed on the OSK this poll, or 0 if none.
+sys_pollin::
+ call pad_poll
+ call osk_handle ; CF set + A = char if a key was pressed
+ ret c
+ xor a
+ ret