diff --git a/src/device/kbc_at.c b/src/device/kbc_at.c index 8c94685b7..9ba84888c 100644 --- a/src/device/kbc_at.c +++ b/src/device/kbc_at.c @@ -1189,6 +1189,20 @@ write60_ami(void *priv, uint8_t val) return 1; } +void +kbc_at_set_ps2(void *priv, const uint8_t ps2) +{ + atkbc_t *dev = (atkbc_t *) priv; + + dev->ami_flags = (dev->ami_flags & 0xfe) | (!!ps2); + dev->misc_flags &= ~FLAG_PS2; + if (ps2) { + dev->misc_flags |= FLAG_PS2; + kbc_at_do_poll = kbc_at_poll_ps2; + } else + kbc_at_do_poll = kbc_at_poll_at; +} + static uint8_t write64_ami(void *priv, uint8_t val) { diff --git a/src/include/86box/keyboard.h b/src/include/86box/keyboard.h index 846123627..bf9a76d73 100644 --- a/src/include/86box/keyboard.h +++ b/src/include/86box/keyboard.h @@ -278,6 +278,7 @@ extern int keyboard_isfsexit(void); extern int keyboard_isfsexit_up(void); extern int keyboard_ismsexit(void); extern void keyboard_set_is_amstrad(int ams); +extern void kbc_at_set_ps2(void *priv, uint8_t ps2); extern void kbc_at_set_fast_reset(uint8_t new_fast_reset); extern void kbc_at_handler(int set, void *priv);