trs80m1: keyboard updates
authorAlan Cox <alan@linux.intel.com>
Wed, 4 Jul 2018 23:34:47 +0000 (00:34 +0100)
committerAlan Cox <alan@linux.intel.com>
Wed, 4 Jul 2018 23:34:47 +0000 (00:34 +0100)
Kernel/platform-trs80m1/README
Kernel/platform-trs80m1/devtty.c

index 90e2e29..aa115c1 100644 (file)
@@ -6,26 +6,27 @@ This port supports the following configurations currently
        Options:
                Floppy Disk
                Hard Disk (Tandy compatible)
-               Lower Case Kit
+               Lower Case Kit (Optional, either Tandy or the simple mods)
                Percom Compatible Doubler
                Holmes style speed up board (anything using port 254 bit 0)
+               Real Time Clock (supported for time locking, can't do dates as
+                                is not Y2K capable)
+
        In Progress:
                Exatron stringy
                HR1G Graphics Card
-               Real Time Clock (supported for time locking but not yet
-                                date setting)
        Planned:
-               Holmes speed up board (using port 95)
                Orchestra 80 sound card
                Alpha Products Joystick
 
        TRS80 model III with Alpha SuperMem (or compatibles), 256K+ recommended
        Options:
                Hard Disk (Tandy compatible, so not afaik MIOSYS)
+               Holmes speed up board (using port 95)
+               Real Time Clock (supported for time locking, can't do dates as
+                                is not Y2K capable)
        In Progress:
                Micro Labs Graphyx
-               Real Time Clock (supported for time locking but not yet
-                                date setting)
                Tandy Hi-Res Card
        Planned:
                Orchestra 90 sound card
@@ -33,7 +34,7 @@ This port supports the following configurations currently
 Under Investigation:
 
        Video Genie I/II with banked memory (eg via S100)
-       LNW80 with banked memory
+       LNW80 with banked memory (selector and similar)
 
 
 Not Supported:
index e7d418b..ac27f23 100644 (file)
@@ -215,6 +215,29 @@ static void keyproc(void)
        }
 }
 
+/*
+ *     The TRS80 keyboard is a little lacking in some rather useful symbols
+ *
+ *     There are conventions for some of these
+ *     shift-0 is capslock
+ *     downarrow-xx is ctrl
+ *     There was also a popular keyboard mod
+ *
+ *     We also map as follows
+ *     left arrow - backspace
+ *     right arrow - delete
+ *     shift left/right arrow - switch vt
+ *     stop - ^C
+ *     control-shift-brackets give curly brackets
+ *     control-shift minus gives underscore
+ *     control-shift slash gives backquote
+ *     control-shift les-than gives hat
+ *     control-brackets gives square brackets
+ *     control-minus gives pipe
+ *
+ *     We may want to add others if need be
+ */
+
 uint8_t keyboard[8][8] = {
        {'@', 'a', 'b', 'c', 'd', 'e', 'f', 'g' },
        {'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o' },
@@ -222,11 +245,11 @@ uint8_t keyboard[8][8] = {
        {'x', 'y', 'z',   0,   0,   0,   0,  0  },
        {'0', '1', '2', '3', '4', '5', '6', '7' },
        {'8', '9', ':', ';', ',', '-', '.', '/' },
-       { KEY_ENTER, KEY_CLEAR, KEY_STOP, KEY_UP, 0/*KEY_DOWN*/, KEY_LEFT, KEY_RIGHT, ' '},
+       { KEY_ENTER, KEY_CLEAR, KEY_STOP, KEY_UP, 0/*KEY_DOWN*/, KEY_BS, KEY_DEL, ' '},
        /* The Model 1 only has bit 0 of this for its shift key. The Model 3
           has bit 2 for right shift. Some add-ons used bit 4 for control,
           other things borrowed the down arrow */
-       { 0, 0, 0, 0, 0, 0, 0, 0 }
+       { 0, 0, 0, 0, KEY_CAPSLOCK, 0, 0, 0 }
 };
 
 uint8_t shiftkeyboard[8][8] = {
@@ -234,10 +257,10 @@ uint8_t shiftkeyboard[8][8] = {
        {'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O' },
        {'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W' },
        {'X', 'Y', 'Z',   0,   0,   0,   0,  0  },
-       {'0', '!', '"', '#', '$', '%', '&', '\'' },
+       { KEY_CAPSLOCK, '!', '"', '#', '$', '%', '&', '\'' },
        {'(', ')', '*', '+', '<', '=', '>', '?' },
        { KEY_ENTER, KEY_CLEAR, KEY_STOP, KEY_UP, 0/*KEY_DOWN*/, KEY_LEFT, KEY_RIGHT, ' '},
-       { 0, 0, 0, 0, 0, 0, 0, 0 }
+       { 0, 0, 0, 0, KEY_CAPSLOCK, 0, 0, 0 }
 };
 
 static uint8_t capslock = 0;
@@ -247,11 +270,11 @@ static void keydecode(void)
 {
        uint8_t c;
 
-       if (keybyte == 7 && keybit == 3) {
+       /* Convention for capslock or the mod */
+       if (c == KEY_CAPSLOCK) {
                capslock = 1 - capslock;
                return;
        }
-
        /* Only the model 3 has right shift (2) */
        if (keymap[7] & 3) {    /* shift (left/right) */
                c = shiftkeyboard[keybyte][keybit];