From aa8d9fe5e66fc6607565e010ff2573cbef58f0f3 Mon Sep 17 00:00:00 2001 From: tmk Date: Sat, 16 Jan 2021 15:29:59 +0900 Subject: [PATCH] pc98_usb: Add keyboard identify support --- converter/pc98_usb/matrix.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/converter/pc98_usb/matrix.c b/converter/pc98_usb/matrix.c index 14ddd85d..ce5a5b37 100644 --- a/converter/pc98_usb/matrix.c +++ b/converter/pc98_usb/matrix.c @@ -82,6 +82,22 @@ RETRY: if (code != 0xFA) goto RETRY; } +static bool pc98_is_newtype(void) +{ + uint16_t code; + pc98_send(0x9F); + code = pc98_wait_response(); + if (code != 0xFA) return false; + + code = pc98_wait_response(); + if (code != 0xA0) return false; + + code = pc98_wait_response(); + if (code != 0x80) return false; + + return true; +} + static uint8_t pc98_led = 0; static void pc98_led_set(void) { @@ -118,6 +134,7 @@ void matrix_init(void) PC98_RST_PORT |= (1<