From acfe94a4c70e6cff887766298d112d4cb324e131 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 28 Jan 2022 22:25:33 -0500 Subject: [PATCH] command keys: * command 1 - command 4 equivalent to PF1 - PF4 * command-delete = backspace (0x7f) * command-return = linefeed (0x0a) --- vt100.key.S | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/vt100.key.S b/vt100.key.S index f3f9f81..1f5ce51 100644 --- a/vt100.key.S +++ b/vt100.key.S @@ -38,7 +38,7 @@ keypress ent sta mod sta KEYSTROBE bit #kmOption!kmCommand - bne :command + bne command bit #kmKeypad bne keypad @@ -68,8 +68,45 @@ keypress ent lda #$08 :send jmp dispatch -:command ; or option - rts +command ; or option + +* apple-return -> linefeed +* apple-backspace -> delete + + + lda key + cmp #$7f + beq :bs + cmp #$0d + beq :lf + + cmp #:MIN + blt :rts + cmp #:MAX+1 + bcs :rts + sec + sbc #:MIN + asl + tax + jmp (:table,x) + +:rts rts + + +:MIN equ 49 +:MAX equ 52 + +:bs jmp dispatch ; +:lf lda #$0a + jmp dispatch + + +:table + dw pf1 ; 1 + dw pf2 ; 2 + dw pf3 ; 3 + dw pf4 ; 4 + keypad