From e94fd4ba2a4f38e2818a0d4cd5ebc5aeadfde789 Mon Sep 17 00:00:00 2001 From: tmk Date: Sat, 10 Jun 2023 22:15:47 +0900 Subject: [PATCH] pc98_usb: Add Windows and Menu key support Command sequence: 0x95, 0x03 http://www.webtech.co.jp/company/doc/undocumented_mem/io_kb.txt --- converter/pc98_usb/matrix.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/converter/pc98_usb/matrix.c b/converter/pc98_usb/matrix.c index 029c599f..667e6351 100644 --- a/converter/pc98_usb/matrix.c +++ b/converter/pc98_usb/matrix.c @@ -105,6 +105,19 @@ static bool pc98_is_newtype(void) return true; } +static void pc98_enable_winkey(void) +{ + uint16_t code; +RETRY: + pc98_send(0x95); + code = pc98_wait_response(); + if (code != 0xFA) return; + + pc98_send(0x03); + code = pc98_wait_response(); + if (code != 0xFA) goto RETRY; +} + static uint8_t pc98_led = 0; static void pc98_led_set(void) { @@ -140,9 +153,15 @@ void matrix_init(void) serial_init(); _delay_ms(50); - if (pc98_is_newtype()) xprintf("new type\n"); else xprintf("old type\n"); + xprintf("\nKeyboard Type: "); + if (pc98_is_newtype()) xprintf("[NEW]"); else xprintf("[OLD]"); + + xprintf("\nInhibit Repeat: "); pc98_inhibit_repeat(); + xprintf("\nEnable Winkey: "); + pc98_enable_winkey(); + // initialize matrix state: all keys off for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;