From c4c3252f751b12471a8fbe1abc9c267bcc8ad1c0 Mon Sep 17 00:00:00 2001 From: Bobbi Webber-Manners Date: Wed, 14 Aug 2024 15:51:08 -0400 Subject: [PATCH] Caps lock function. Improved line-drawing char mapping. --- drivers/a2vt100.s | 115 +++++++++++++++++++++++++++++++++------------- 1 file changed, 83 insertions(+), 32 deletions(-) diff --git a/drivers/a2vt100.s b/drivers/a2vt100.s index cad2137..2724423 100644 --- a/drivers/a2vt100.s +++ b/drivers/a2vt100.s @@ -25,7 +25,9 @@ videx = 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; TODO for VIDEX -; - Keybindings for { } \ ` ~ _ -- Maybe use Escape prefix ?? +; - Prefix / lead in key alternate key map +; - Make it harder to quit by mistake +; - Support ][+ WITHOUT shift key mod ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ************************************* @@ -144,7 +146,8 @@ mul10buf .res 1 .ifdef videx VidexBase .res 2 ; Videx screen base address -VidexCurs .res 2 ; Videx cursor address +VidexCurs .res 2 ; Videx cursor address +CapsLock .res 1 ; Caps lock status $00 off, $FF on ; Device in slot 3 START = $6fb ; Videx screen start address (slot 3 screen hole) @@ -898,20 +901,20 @@ aDDigE rts ProcOut .ifdef videx - cpy #40 ; Key<40 .. - bcc PO1 ; .. ignore shift key - bit $c063 ; Read PB3 "shift mod" - bpl PO1 ; Shifted + cpy #40 ; Key<40 .. + bcc PO1 ; .. ignore shift key + jsr IsShifted + bcs PO1 ; Shifted tya - ora #$20 ; Set bit 6 for unshifted chars + ora #$20 ; Set bit 6 for unshifted chars tay PO1 .endif - lda kta,y ; keyboard to ASCII + lda kta,y ; keyboard to ASCII cmp #$ff - beq POrts ; ignore key + beq POrts ; ignore key cmp #$fe - beq CmdKey ; command key + beq CmdKey ; command key PO2 jsr putRS POrts rts @@ -1032,8 +1035,8 @@ CmdKey tya ; restore character ; --- ^J --- cmp #$0a bne C0 - bit $c063 ; PB3 shift key - bpl crsrL ; pressed + jsr IsShifted + bcs crsrL ; pressed jsr putRS ; send ^J rts crsrL ldx # { [$7b] ; Shift-Ctrl-B [$02] -> \ [$5c] +; Shift-Ctrl-C [$03] -> { [$7b] ; Shift-Ctrl-G [$07] -> ` [$60] ; Shift-Ctrl-N ^^ [$1e] -> ^ [$5e] ; Shift-Ctrl-P ^@ [$00] -> @ [$40] -; Shift-Ctrl-S [$13] -> } [$7d] ; Shift-Ctrl-T [$14] -> ~ [$7e] ; Shift-Ctrl-U [$15] -> _ [$5f] +; Shift-Ctrl-V [$16] -> } [$7d] ; Shift-Ctrl-X [$18] -> ] [$5d] ; Shift-Ctrl-Z [$1a] -> [ [$5b] +; Shift-Ctrl-?? [$??] -> | [$7c] TODO videxbind ; _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f -.byt $40,$7b,$5c,$00,$00,$00,$00,$60,$00,$00,$00,$00,$00,$00,$00,$00 ; 0_ -.byt $00,$00,$00,$7d,$7e,$5f,$00,$00,$5d,$00,$5b,$00,$00,$00,$5e,$00 ; 1_ +.byt $40,$00,$5c,$7b,$00,$00,$00,$60,$00,$00,$00,$00,$00,$00,$00,$00 ; 0_ +.byt $00,$00,$00,$00,$7e,$5f,$7d,$00,$5d,$00,$5b,$00,$00,$00,$5e,$00 ; 1_ .endif ; ------------------------------------- @@ -1551,6 +1571,21 @@ VidexGet VG1 ldy BASL ; Offset in second half of 512 byte page lda $cd00,y rts + +; ------------------------------------- +; IsShifted - determine if shift is enabled +; +; Returns C set if shift on, C clear otherwise +; ------------------------------------- +IsShifted + bit CapsLock ; Check caps lock toggle + bmi IS1 ; Caps lock on + bit $c063 ; Read PB3 "shift mod" + bpl IS1 ; Shifted + clc + rts +IS1 sec + rts .endif ; ------------------------------------- @@ -2168,6 +2203,7 @@ InitScr sta VidexBase sta VidexBase+1 sta START + sta CapsLock ldx #12 ; Register 12 - MSbyte of start address stx SL3DEV0 sta SL3DEV1 @@ -2206,8 +2242,13 @@ IS1 txa ; ------------------------------------- ExitScr +.ifndef videx ; --- erase screen --- jsr $fc58 ; clear current text screen +.else + lda #$8c + jsr $c300 ; Initialize Videoterm and clear screen +.endif rts ; ************************************* @@ -2256,11 +2297,21 @@ ltsc;_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f ; --- reverse ------------------------------------------------------ ; ◆ ▒ ␉ ␌ ␍ ␊ ° ± ␤ ␋ ┘ ┐ ┌ └ ┼ ⎺ +.ifndef videx ; ' ' ▒ ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' | ' ' ' ' | | _ .byt $20,$57,$20,$20,$20,$20,$20,$20,$20,$20,$7c,$20,$20,$7c,$7c,$1f ; 2_ +.else +; ' ' ▒ ␉ ␌ ␍ ␊ ' ' ' ' ' ' ␋ ┘ ┐ ┌ └ ┼ ⎺ +.byt $a0,$ff,$89,$8b,$8c,$8a,$a0,$a0,$a0,$8b,$99,$9c,$96,$93,$9f,$81 ; 6_ +.endif ; ⎻ ─ ⎼ ⎽ ├ ┤ ┴ ┬ │ ≤ ≥ π ≠ £ · ' ' +.ifndef videx ; _ _ _ _ | | _ _ | ' ' ' ' ' ' ' ' ' ' ' ' ' ' .byt $1f,$1f,$1f,$1f,$7c,$7c,$1f,$1f,$7c,$20,$20,$20,$20,$20,$20,$20 ; 3_ +.else +; ⎻ ─ _ _ ├ ┤ ┴ ┬ │ ' ' ' ' ' ' ' ' ' ' . ' ' +.byt $81,$9a,$cf,$cf,$97,$9d,$9b,$9e,$95,$a0,$a0,$a0,$a0,$a0,$ae,$a0 ; 7_ +.endif ; --- unused ------------------------------------------------------- .byt $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ; 4_ @@ -2272,16 +2323,16 @@ ltsc;_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f ; ◆ ▒ ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ⎸ ' ' _ ⎿ ⎿ ⎺ .byt $5b,$56,$a0,$a0,$a0,$a0,$a0,$a0,$a0,$a0,$5f,$a0,$9f,$54,$54,$4c ; 6_ .else -; ' ' ▒ ␉ ␌ ␍ ␊ ' ' ' ' ' ' ' ' ┘ ┐ ┌ └ ┼ ⎺ -.byt $a0,$7f,$09,$0b,$0c,$0a,$a0,$a0,$a0,$a0,$19,$1c,$16,$13,$1f,$4c ; 6_ +; ' ' ▒ ␉ ␌ ␍ ␊ ' ' ' ' ' ' ␋ ┘ ┐ ┌ └ ┼ ⎺ +.byt $20,$7f,$09,$0b,$0c,$0a,$20,$20,$20,$0b,$19,$1c,$16,$13,$1f,$01 ; 6_ .endif -; ⎻ ─ ⎼ ⎽ ├ ┤ ┴ ┬ │ ≤ ≥ π ≠ £ · ' ' +; ⎻ ─ ⎼ ⎽ ├ ┤ ┴ ┬ │ ≤ ≥ π ≠ £ · ' ' .ifndef videx ; ─ _ _ _ ⎿ ⎸ ⎿ _ ⎸ ' ' ' ' ' ' ' ' ' ' ' ' ' ' .byt $53,$9f,$9f,$9f,$54,$5f,$54,$9f,$5f,$a0,$a0,$a0,$a0,$a0,$a0,$a0 ; 7_ .else -; ─ ─ _ _ ⎿ ⎸ ┴ _ │ ' ' ' ' ' ' ' ' ' ' ' ' ' ' -.byt $53,$1a,$9f,$9f,$54,$5f,$1b,$9f,$15,$a0,$a0,$a0,$a0,$a0,$a0,$a0 ; 7_ +; ⎻ ─ _ _ ├ ┤ ┴ ┬ │ ' ' ' ' ' ' ' ' ' ' . ' ' +.byt $01,$1a,$5f,$5f,$17,$1d,$1b,$1e,$15,$20,$20,$20,$20,$20,$2e,$20 ; 7_ .endif ; -------------------------------------