fix videx keymappings fix applesoft keytest prog

- fixed the videx-like keymappings for the upper/lower keyboard
- moved @ to SHIFT-0 from CTRL-0, and put ID on CTRL-0
- bind the applesoft key test program to CTRL-3
- cram the keyboard test program into one line, to avoid adding a delay
 for BASIC parsing after the CR.
 - in main(), output only printable codes less than INVALID_CODE,
- instead of checking for code != INVALID_CODE.
This commit is contained in:
Dave 2023-01-02 03:06:10 -06:00
parent 8c8e021061
commit 62b27e0a3d
4 changed files with 12 additions and 17 deletions

View File

@ -62,7 +62,7 @@ elseif(ARCH MATCHES atmega640 OR ARCH MATCHES atmega1280 OR ARCH MATCHES atmega2
endif()
project("asdf"
VERSION 1.6.4
VERSION 1.6.5
DESCRIPTION "A customizable keyboard matrix controller for retrocomputers"
LANGUAGES C)

View File

@ -42,7 +42,7 @@
#include "asdf_hook.h"
#define APPLESOFT_KEYBOARD_TEST ASDF_HOOK_USER_3
#define APPLE2_ID_MESSAGE ASDF_HOOK_USER_4
#define APPLE2_ID_MESSAGE ASDF_HOOK_USER_10
#define APPLE2_ASCII_TEST ASDF_HOOK_USER_11
#define APPLE2_PRINT_DELAY 40 // msec

View File

@ -88,7 +88,7 @@ const FLASH apple_keycode_matrix_t apple_shift_matrix = {
[4] = { ACTION_NOTHING, 'I', 'U', 'Y', 'T', 'R', 'E', 'W' },
[5] = { ACTION_NOTHING, ACTION_NOTHING, ACTION_NOTHING, ASCII_CR, ASCII_AT, 'O', 'L', '>' },
[6] = { ACTION_NOTHING, ACTION_NOTHING, APPLE_ACTION_CLEAR, '=',
'*', ASCII_ZERO, ASCII_RT_PAREN, ASCII_LT_PAREN },
'*', ASCII_AT, ASCII_RT_PAREN, ASCII_LT_PAREN },
[7] = { APPLE_LEFT_ARROW, ASCII_SINGLE_QUOTE, '&', '%', '$', '#', ASCII_DOUBLE_QUOTE, '!' },
ASDF_APPLE2_DIP_SWITCHES
};
@ -102,7 +102,7 @@ const FLASH apple_keycode_matrix_t apple_caps_shift_matrix = {
[4] = { ACTION_NOTHING, 'I', 'U', 'Y', 'T', 'R', 'E', 'W' },
[5] = { ACTION_NOTHING, ACTION_NOTHING, ACTION_NOTHING, ASCII_CR, ACTION_REPEAT, 'O', 'L', '>' },
[6] = { ACTION_NOTHING, ACTION_NOTHING, APPLE_ACTION_CLEAR, '=',
'*', ASCII_ZERO, ASCII_RT_PAREN, ASCII_LT_PAREN },
'*', ACTION_NOTHING, ASCII_RT_PAREN, ASCII_LT_PAREN },
[7] = { APPLE_LEFT_ARROW, ASCII_SINGLE_QUOTE, '&', '%', '$', '#', ASCII_DOUBLE_QUOTE, '!' },
ASDF_APPLE2_DIP_SWITCHES
};
@ -134,8 +134,8 @@ const FLASH apple_keycode_matrix_t apple_ctrl_matrix = {
[5] = { ACTION_NOTHING, ACTION_NOTHING, ACTION_NOTHING, ASCII_CR,
ACTION_REPEAT, ASCII_CTRL_O, ASCII_CTRL_L, ASCII_RT_SQUARE_BRACE },
[6] = { ACTION_NOTHING, ACTION_NOTHING, APPLE_ACTION_RESET, ASCII_UNDERSCORE,
ACTION_NOTHING, ASCII_AT, ASCII_RT_CURLY_BRACE, ASCII_LT_CURLY_BRACE },
[7] = { APPLE_LEFT_ARROW, ASCII_GRAVE_ACCENT, ASCII_CARET, ACTION_FN_5,
ACTION_NOTHING, ACTION_FN_10, ASCII_RT_CURLY_BRACE, ASCII_LT_CURLY_BRACE },
[7] = { ASCII_DEL, ASCII_GRAVE_ACCENT, ASCII_CARET, ACTION_FN_5,
ACTION_FN_4, ACTION_FN_3, ASCII_TILDE, ASCII_VERT_BAR },
ASDF_APPLE2_DIP_SWITCHES
};
@ -151,13 +151,7 @@ static const apple_keycode_matrix_t *apple_maps[] = {
void applesoft_keyboard_test(void)
{
asdf_print("10 GET A$\r");
asdf_print("20 A = ASC(A$)\r");
asdf_print("30 IF A < 32 THEN A$=\"CTL+\"+CHR$(A + 64)\r");
asdf_print("40 ?\"'\";A$;\"' = \";A:\r");
asdf_print("50 IF A <> 3 GOTO 10\r");
asdf_print("60 END\rRUN\r");
asdf_print("10GETA$(0):A=ASC(A$(0)):A$(1)=\"CTL+\"+CHR$(A + 64):?\"'\";A$(A<32);\"' = \";A:IFA<>3GOTO10\r");
}
void apple_add_map(const apple_map_index_t map_index,

View File

@ -68,10 +68,11 @@ int main(void)
if (asdf_arch_tick()) {
asdf_keycode_t code = asdf_next_code();
if (code != ASDF_INVALID_CODE) {
void (*output_function)(asdf_keycode_t) =
(void (*)(asdf_keycode_t)) asdf_hook_get(ASDF_HOOK_OUTPUT);
(*output_function)(code);
if (code < ASDF_INVALID_CODE) {
// This is inside the loop because the output function may change
void (*output_function)(asdf_keycode_t) =
(void (*)(asdf_keycode_t)) asdf_hook_get(ASDF_HOOK_OUTPUT);
(*output_function)(code);
}
asdf_keyscan();
}