From 96cfc32511ae15ecb7b62486f44b39054db7f61c Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Mon, 4 Sep 2017 20:03:50 +0200 Subject: [PATCH] Atari: fix stray cursor image when connecting to BSDs. FreeBSD and NetBSD, at least, have a banner message when you telnet into them which has an empty line as first line. On those systems, an old "cursor" char was visible at the top of the login prompt message. This is fixed by enabling and disabling the cursor in 'get_key' while waiting for a key press. --- drivers/atrinput.s | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/atrinput.s b/drivers/atrinput.s index 19885ad..2d52b26 100644 --- a/drivers/atrinput.s +++ b/drivers/atrinput.s @@ -9,6 +9,7 @@ .exportzp abort_key_disable = 0 .import ip65_process +.import print_a .data @@ -75,8 +76,26 @@ special_key_table2: ; inputs: none ; outputs: A contains ASCII value of key just pressed get_key: + lda #0 + sta CRSINH ; cursor on + ; according to "Mapping the Atari", a change to CRSINH will only be in effect after the next cursor movement, + ; so we move the cursor one to the left and then one to the right (to keep its original position) + lda #ATLRW + jsr print_a + lda #ATRRW + jsr print_a +@loop: jsr get_key_if_available - bcc get_key + bcc @loop + ldy #1 + sty CRSINH ; cursor on + tay ; save key + ; see above comment wrt. "Mapping the Atari" + lda #ATLRW + jsr print_a + lda #ATRRW + jsr print_a + tya ; restore key rts ; inputs: none