From 6f72758587b5c7088ce2377c1745bfe0460aa16e Mon Sep 17 00:00:00 2001 From: Greg King Date: Tue, 24 Dec 2013 15:26:05 -0500 Subject: [PATCH] Reset the stdin console when a program starts. --- libsrc/atmos/read.s | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/libsrc/atmos/read.s b/libsrc/atmos/read.s index e6e1f7eee..443808fa8 100644 --- a/libsrc/atmos/read.s +++ b/libsrc/atmos/read.s @@ -7,6 +7,7 @@ ; .export _read + .constructor initstdin .import popax .importzp ptr1, ptr2, ptr3 @@ -63,8 +64,22 @@ L9: lda ptr3 .endproc -.data + +;-------------------------------------------------------------------------- +; initstdin: Reset the stdin console. + +.segment "INIT" + +initstdin: + ldx #<-1 + stx text_count + rts + + +;-------------------------------------------------------------------------- + +.bss text_count: - .byte <-1 + .res 1 -- 2.39.5