From 35a2f12cce6104d01c1fdc7c6970e84a7ffe8780 Mon Sep 17 00:00:00 2001 From: Gale Faraday Date: Sun, 28 Sep 2025 15:28:16 -0500 Subject: [PATCH] feat(buzbee): implement terminal echo and backspace handling --- src/buzbee.s | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/buzbee.s b/src/buzbee.s index 69e12b9..ad8a043 100644 --- a/src/buzbee.s +++ b/src/buzbee.s @@ -48,10 +48,14 @@ INPLOOP beq NOCHAR@ cmpa #$1B ; ESC? beq HESC@ ; Handle ESC + cmpa #$08 ; BS? + beq HBACKSPC@ ; Backup a char cmpa #$0D ; CR? beq EXIT@ ; Then parse input buffer cmpy #BBIN_DEPTH ; Are we at the end of the input buffer? beq FULLBUF@ ; Handle the buffer being full +ECHO@ + jsr POUTCHAR ; Echo char back, this includes BS chars sta BBIN_BASE,y ; Add it to the input buffer leay 1,y NOCHAR@ @@ -81,6 +85,11 @@ HESC@ jsr POUTCHAR ldy #$0000 ; On return we cmpy #$0000 and if eq then newline. rts +HBACKSPC@ + clrb ; Clear last char + leay -1,y + stb BBIN_BASE + bra ECHO@ ; Echo the char in A FULLBUF@ lda #$07 ; ASCII BEL jsr POUTCHAR