From 81ab3b41e1ea12bc80c62f7fb9c75abc1e4c1192 Mon Sep 17 00:00:00 2001 From: Christian Werner Date: Sun, 18 Oct 2026 12:05:12 +0200 Subject: [PATCH] fix(arnitech): INS in insert mode opens another space In the spaces INS opened the Terminal driver sent INS to Literal, which drew it as a glyph. On a C64 the INST key "inserts spaces normally" in insert mode and shows as a reverse character only in quote mode (Programmer's Reference Guide, the screen editor, p. 96), so INS now goes to Output there and counts INSRT up when it opened a space. --- src/kernal/arnitech/arnitech_terminal.s | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/kernal/arnitech/arnitech_terminal.s b/src/kernal/arnitech/arnitech_terminal.s index 3bcbebc7..64bfcdb0 100644 --- a/src/kernal/arnitech/arnitech_terminal.s +++ b/src/kernal/arnitech/arnitech_terminal.s @@ -29,8 +29,9 @@ terminal_find: ; ; Outside quote and insert mode the byte goes to Output. While either is on, every control code ; but RETURN, SHIFT+RETURN, and STOP goes to Literal, which draws it as a glyph; so does DEL -; while INSRT is not 0, which a DEL between quotes leaves to delete. RETURN, SHIFT+RETURN, and -; STOP end both modes. A glyph drawn counts INSRT down, a quote toggles QTSW, and an INS that +; while INSRT is not 0, which a DEL between quotes leaves to delete, but INS then opens another +; space, as on a C64 (Programmer's Reference Guide, p. 96). RETURN, SHIFT+RETURN, and STOP end +; both modes. A glyph drawn counts INSRT down, a quote toggles QTSW, and an INS that ; opened a space (status bit 3) counts INSRT up. ; @@ -78,7 +79,11 @@ chrout_terminal_control: beq chrout_terminal_end_modes ldy INSRT - bne chrout_terminal_literal ; in the spaces INS opened, DEL too is a glyph + beq @1 + cmp #KEY_INS + beq chrout_terminal_code ; in the spaces INS opened, INS opens another + bne chrout_terminal_literal ; ... and DEL too is a glyph +@1: ldy QTSW beq chrout_terminal_code cmp #KEY_DEL