From 3c7cdfa0f9fdda9e4a92dddbacf44d1919bfb85d Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 14 Nov 2021 20:47:08 +0100 Subject: [PATCH] Implemented more AMI KBC commands, should fix the AMI Excalibur PCI-II. --- src/device/keyboard_at.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/device/keyboard_at.c b/src/device/keyboard_at.c index a210fd41d..b7cd3951e 100644 --- a/src/device/keyboard_at.c +++ b/src/device/keyboard_at.c @@ -1320,6 +1320,11 @@ write60_ami(void *priv, uint8_t val) } return 0; + case 0xc1: + kbd_log("ATkbc: AMI MegaKey - write %02X to input port\n", val); + dev->input_port = val; + return 0; + case 0xcb: /* set keyboard mode */ kbd_log("ATkbc: AMI - set keyboard mode\n"); dev->ami_flags = val; @@ -1475,6 +1480,24 @@ write64_ami(void *priv, uint8_t val) add_data(dev, 0x00); return 0; + case 0xc1: /* write input port */ + kbd_log("ATkbc: AMI MegaKey - write input port\n"); + dev->want60 = 1; + return 0; + + case 0xc4: + /* set KBC line P14 low */ + kbd_log("ATkbc: set KBC line P14 (input port bit 4) low\n"); + dev->input_port &= 0xef; + add_data(dev, 0x00); + return 0; + case 0xc5: + /* set KBC line P15 low */ + kbd_log("ATkbc: set KBC line P15 (input port bit 5) low\n"); + dev->input_port &= 0xdf; + add_data(dev, 0x00); + return 0; + case 0xc8: /* * unblock KBC lines P22/P23 @@ -1493,6 +1516,19 @@ write64_ami(void *priv, uint8_t val) dev->output_locked = 1; return 0; + case 0xcc: + /* set KBC line P14 high */ + kbd_log("ATkbc: set KBC line P14 (input port bit 4) high\n"); + dev->input_port |= 0x10; + add_data(dev, 0x00); + return 0; + case 0xcd: + /* set KBC line P15 high */ + kbd_log("ATkbc: set KBC line P15 (input port bit 5) high\n"); + dev->input_port |= 0x20; + add_data(dev, 0x00); + return 0; + case 0xef: /* ??? - sent by AMI486 */ kbd_log("ATkbc: ??? - sent by AMI486\n"); return 0;