diff options
author | Ian C <ianc@noddybox.co.uk> | 2020-03-20 22:22:20 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2020-03-20 22:22:20 +0000 |
commit | 7cd8ce63a8a2985e0edd8cfec45d675fe6ff9335 (patch) | |
tree | 591720499dec2a5249c3029e8bb6d179b2963080 /src | |
parent | d9beac69eb3b1c3678a3ac9498adff99cde4a8c6 (diff) |
Added extra keys.
Diffstat (limited to 'src')
-rw-r--r-- | src/czx81.c | 95 |
1 files changed, 86 insertions, 9 deletions
diff --git a/src/czx81.c b/src/czx81.c index 6d2f60f..14bc25b 100644 --- a/src/czx81.c +++ b/src/czx81.c @@ -162,11 +162,83 @@ static struct {'c', 1, {0}, {0x08}}, {'v', 1, {0}, {0x10}}, - {'b', 1, {6}, {0x10}}, - {'n', 1, {6}, {0x08}}, - {'m', 1, {6}, {0x04}}, - {'.', 1, {6}, {0x02}}, - {' ', 1, {6}, {0x01}}, + {'b', 1, {7}, {0x10}}, + {'n', 1, {7}, {0x08}}, + {'m', 1, {7}, {0x04}}, + {'.', 1, {7}, {0x02}}, + {' ', 1, {7}, {0x01}}, + + /* Shifted alpha + */ + {'Q', 2, {0, 2}, {0x01, 0x01}}, + {'W', 2, {0, 2}, {0x01, 0x02}}, + {'E', 2, {0, 2}, {0x01, 0x04}}, + {'R', 2, {0, 2}, {0x01, 0x08}}, + {'T', 2, {0, 2}, {0x01, 0x10}}, + {'Y', 2, {0, 5}, {0x01, 0x10}}, + {'U', 2, {0, 5}, {0x01, 0x08}}, + {'I', 2, {0, 5}, {0x01, 0x04}}, + {'O', 2, {0, 5}, {0x01, 0x02}}, + {'P', 2, {0, 5}, {0x01, 0x01}}, + {'A', 2, {0, 1}, {0x01, 0x01}}, + {'S', 2, {0, 1}, {0x01, 0x02}}, + {'D', 2, {0, 1}, {0x01, 0x04}}, + {'F', 2, {0, 1}, {0x01, 0x08}}, + {'G', 2, {0, 1}, {0x01, 0x10}}, + {'H', 2, {0, 6}, {0x01, 0x10}}, + {'J', 2, {0, 6}, {0x01, 0x08}}, + {'K', 2, {0, 6}, {0x01, 0x04}}, + {'L', 2, {0, 6}, {0x01, 0x02}}, + {'Z', 2, {0, 0}, {0x01, 0x02}}, + {'X', 2, {0, 0}, {0x01, 0x04}}, + {'C', 2, {0, 0}, {0x01, 0x08}}, + {'V', 2, {0, 0}, {0x01, 0x10}}, + {'B', 2, {0, 6}, {0x01, 0x10}}, + {'N', 2, {0, 6}, {0x01, 0x08}}, + {'M', 2, {0, 6}, {0x01, 0x04}}, + + /* Shifted alpha shortcuts + */ + {'\'', 2, {0, 2}, {0x01, 0x01}}, + {'$', 2, {0, 5}, {0x01, 0x08}}, + {'(', 2, {0, 5}, {0x01, 0x04}}, + {')', 2, {0, 5}, {0x01, 0x02}}, + {'"', 2, {0, 5}, {0x01, 0x01}}, + {'^', 2, {0, 6}, {0x01, 0x10}}, + {'-', 2, {0, 6}, {0x01, 0x08}}, + {'+', 2, {0, 6}, {0x01, 0x04}}, + {'=', 2, {0, 6}, {0x01, 0x02}}, + {':', 2, {0, 0}, {0x01, 0x02}}, + {';', 2, {0, 0}, {0x01, 0x04}}, + {'?', 2, {0, 0}, {0x01, 0x08}}, + {'/', 2, {0, 0}, {0x01, 0x10}}, + {'*', 2, {0, 6}, {0x01, 0x10}}, + {'<', 2, {0, 6}, {0x01, 0x08}}, + {'>', 2, {0, 6}, {0x01, 0x04}}, + {',', 2, {0, 7}, {0x01, 0x02}}, + + /* Cursor keys + */ + {KEY_LEFT, 2, {0, 3}, {0x01, 0x10}}, + {KEY_DOWN, 2, {0, 4}, {0x01, 0x10}}, + {KEY_UP, 2, {0, 4}, {0x01, 0x08}}, + {KEY_RIGHT, 2, {0, 4}, {0x01, 0x04}}, + + /* Function keys + */ + {KEY_F(1), 2, {0, 3}, {0x01, 0x01}}, + {KEY_F(2), 2, {0, 3}, {0x01, 0x02}}, + {KEY_F(3), 2, {0, 3}, {0x01, 0x04}}, + {KEY_F(4), 2, {0, 3}, {0x01, 0x08}}, + {KEY_F(5), 2, {0, 4}, {0x01, 0x02}}, + {KEY_F(6), 2, {0, 6}, {0x01, 0x01}}, + {KEY_F(7), 2, {0, 7}, {0x01, 0x01}}, + + /* Backspace/delete + */ + {KEY_BACKSPACE,2, {0, 4}, {0x01, 0x01}}, + {KEY_DC, 2, {0, 4}, {0x01, 0x01}}, + {127, 2, {0, 4}, {0x01, 0x01}}, {ERR, 0, {0}, {0}} }; @@ -551,8 +623,6 @@ static Z80Byte ZX81ReadPort(Z80 *z80, Z80Word port) { Z80Byte b = 0; - sprintf(message,"IN() called with %4.4x MARGIN=%d", port, mem[MARGIN]); - switch(port & 0xff) { case 0xfe: @@ -611,6 +681,8 @@ static void ZX81Reset(void) Z80Reset(z80); + FRAME_TSTATES = FAST_TSTATES; + /* 16K of memory */ RAMBOT = 0x4000; @@ -719,8 +791,9 @@ static void Menu() mvprintw(0, 0, "F1 .. Tracing %s", trace ? "ON ":"OFF"); mvprintw(2, 0, "F2 .. Frames per key press: %2d", key_press_frames); - mvprintw(4, 0, "F3 .. Quit"); - mvprintw(6, 0, "Press ESCAPE to resume"); + mvprintw(4, 0, "F3 .. Reset ZX81"); + mvprintw(6, 0, "F4 .. Quit"); + mvprintw(8, 0, "Press ESCAPE to resume"); refresh(); @@ -740,6 +813,10 @@ static void Menu() break; case KEY_F(3): + ZX81Reset(); + break; + + case KEY_F(4): quit = TRUE; done = TRUE; break; |