Added a Hyundai XT keyboard controller with the old behavior (the Hyundai XT BIOS'es rely on it), fixes #3771.
This commit is contained in:
@@ -54,19 +54,22 @@
|
|||||||
#define STAT_IFULL 0x02
|
#define STAT_IFULL 0x02
|
||||||
#define STAT_OFULL 0x01
|
#define STAT_OFULL 0x01
|
||||||
|
|
||||||
// Keyboard Types
|
/* Keyboard Types */
|
||||||
#define KBD_TYPE_PC81 0
|
enum {
|
||||||
#define KBD_TYPE_PC82 1
|
KBD_TYPE_PC81 = 0,
|
||||||
#define KBD_TYPE_XT82 2
|
KBD_TYPE_PC82,
|
||||||
#define KBD_TYPE_XT86 3
|
KBD_TYPE_XT82,
|
||||||
#define KBD_TYPE_COMPAQ 4
|
KBD_TYPE_XT86,
|
||||||
#define KBD_TYPE_TANDY 5
|
KBD_TYPE_COMPAQ,
|
||||||
#define KBD_TYPE_TOSHIBA 6
|
KBD_TYPE_TANDY,
|
||||||
#define KBD_TYPE_VTECH 7
|
KBD_TYPE_TOSHIBA,
|
||||||
#define KBD_TYPE_OLIVETTI 8
|
KBD_TYPE_VTECH,
|
||||||
#define KBD_TYPE_ZENITH 9
|
KBD_TYPE_OLIVETTI,
|
||||||
#define KBD_TYPE_PRAVETZ 10
|
KBD_TYPE_ZENITH,
|
||||||
#define KBD_TYPE_XTCLONE 11
|
KBD_TYPE_PRAVETZ,
|
||||||
|
KBD_TYPE_HYUNDAI,
|
||||||
|
KBD_TYPE_XTCLONE
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct xtkbd_t {
|
typedef struct xtkbd_t {
|
||||||
int want_irq;
|
int want_irq;
|
||||||
@@ -530,7 +533,7 @@ kbd_write(uint16_t port, uint8_t val, void *priv)
|
|||||||
|
|
||||||
switch (port) {
|
switch (port) {
|
||||||
case 0x61: /* Keyboard Control Register (aka Port B) */
|
case 0x61: /* Keyboard Control Register (aka Port B) */
|
||||||
if (!(val & 0x80)) {
|
if (!(val & 0x80) || (kbd->type == KBD_TYPE_HYUNDAI)) {
|
||||||
new_clock = !!(val & 0x40);
|
new_clock = !!(val & 0x40);
|
||||||
if (!kbd->clock && new_clock) {
|
if (!kbd->clock && new_clock) {
|
||||||
key_queue_start = key_queue_end = 0;
|
key_queue_start = key_queue_end = 0;
|
||||||
@@ -540,7 +543,7 @@ kbd_write(uint16_t port, uint8_t val, void *priv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
kbd->pb = val;
|
kbd->pb = val;
|
||||||
if (!(kbd->pb & 0x80))
|
if (!(kbd->pb & 0x80) || (kbd->type == KBD_TYPE_HYUNDAI))
|
||||||
kbd->clock = !!(kbd->pb & 0x40);
|
kbd->clock = !!(kbd->pb & 0x40);
|
||||||
ppi.pb = val;
|
ppi.pb = val;
|
||||||
|
|
||||||
@@ -603,10 +606,10 @@ kbd_read(uint16_t port, void *priv)
|
|||||||
(kbd->type == KBD_TYPE_PC82) || (kbd->type == KBD_TYPE_PRAVETZ) ||
|
(kbd->type == KBD_TYPE_PC82) || (kbd->type == KBD_TYPE_PRAVETZ) ||
|
||||||
(kbd->type == KBD_TYPE_XT82) || (kbd->type == KBD_TYPE_XT86) ||
|
(kbd->type == KBD_TYPE_XT82) || (kbd->type == KBD_TYPE_XT86) ||
|
||||||
(kbd->type == KBD_TYPE_XTCLONE) || (kbd->type == KBD_TYPE_COMPAQ) ||
|
(kbd->type == KBD_TYPE_XTCLONE) || (kbd->type == KBD_TYPE_COMPAQ) ||
|
||||||
(kbd->type == KBD_TYPE_ZENITH))) {
|
(kbd->type == KBD_TYPE_ZENITH) || (kbd->type == KBD_TYPE_HYUNDAI))) {
|
||||||
if ((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) ||
|
if ((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) ||
|
||||||
(kbd->type == KBD_TYPE_XTCLONE) || (kbd->type == KBD_TYPE_COMPAQ) ||
|
(kbd->type == KBD_TYPE_XTCLONE) || (kbd->type == KBD_TYPE_COMPAQ) ||
|
||||||
(kbd->type == KBD_TYPE_PRAVETZ))
|
(kbd->type == KBD_TYPE_PRAVETZ) || (kbd->type == KBD_TYPE_HYUNDAI))
|
||||||
ret = (kbd->pd & ~0x02) | (hasfpu ? 0x02 : 0x00);
|
ret = (kbd->pd & ~0x02) | (hasfpu ? 0x02 : 0x00);
|
||||||
else if ((kbd->type == KBD_TYPE_XT82) || (kbd->type == KBD_TYPE_XT86))
|
else if ((kbd->type == KBD_TYPE_XT82) || (kbd->type == KBD_TYPE_XT86))
|
||||||
/* According to Ruud on the PCem forum, this is supposed to
|
/* According to Ruud on the PCem forum, this is supposed to
|
||||||
@@ -696,7 +699,7 @@ kbd_read(uint16_t port, void *priv)
|
|||||||
case 0x63: /* Keyboard Configuration Register (aka Port D) */
|
case 0x63: /* Keyboard Configuration Register (aka Port D) */
|
||||||
if ((kbd->type == KBD_TYPE_XT82) || (kbd->type == KBD_TYPE_XT86) ||
|
if ((kbd->type == KBD_TYPE_XT82) || (kbd->type == KBD_TYPE_XT86) ||
|
||||||
(kbd->type == KBD_TYPE_XTCLONE) || (kbd->type == KBD_TYPE_COMPAQ) ||
|
(kbd->type == KBD_TYPE_XTCLONE) || (kbd->type == KBD_TYPE_COMPAQ) ||
|
||||||
(kbd->type == KBD_TYPE_TOSHIBA))
|
(kbd->type == KBD_TYPE_TOSHIBA) || (kbd->type == KBD_TYPE_HYUNDAI))
|
||||||
ret = kbd->pd;
|
ret = kbd->pd;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -762,7 +765,7 @@ kbd_init(const device_t *info)
|
|||||||
(kbd->type == KBD_TYPE_PRAVETZ) || (kbd->type == KBD_TYPE_XT82) ||
|
(kbd->type == KBD_TYPE_PRAVETZ) || (kbd->type == KBD_TYPE_XT82) ||
|
||||||
(kbd->type <= KBD_TYPE_XT86) || (kbd->type == KBD_TYPE_XTCLONE) ||
|
(kbd->type <= KBD_TYPE_XT86) || (kbd->type == KBD_TYPE_XTCLONE) ||
|
||||||
(kbd->type == KBD_TYPE_COMPAQ) || (kbd->type == KBD_TYPE_TOSHIBA) ||
|
(kbd->type == KBD_TYPE_COMPAQ) || (kbd->type == KBD_TYPE_TOSHIBA) ||
|
||||||
(kbd->type == KBD_TYPE_OLIVETTI)) {
|
(kbd->type == KBD_TYPE_OLIVETTI) || (kbd->type == KBD_TYPE_HYUNDAI)) {
|
||||||
/* DIP switch readout: bit set = OFF, clear = ON. */
|
/* DIP switch readout: bit set = OFF, clear = ON. */
|
||||||
if (kbd->type == KBD_TYPE_OLIVETTI)
|
if (kbd->type == KBD_TYPE_OLIVETTI)
|
||||||
/* Olivetti M19
|
/* Olivetti M19
|
||||||
@@ -781,7 +784,8 @@ kbd_init(const device_t *info)
|
|||||||
|
|
||||||
/* Switches 3, 4 - memory size. */
|
/* Switches 3, 4 - memory size. */
|
||||||
if ((kbd->type == KBD_TYPE_XT86) || (kbd->type == KBD_TYPE_XTCLONE) ||
|
if ((kbd->type == KBD_TYPE_XT86) || (kbd->type == KBD_TYPE_XTCLONE) ||
|
||||||
(kbd->type == KBD_TYPE_COMPAQ) || (kbd->type == KBD_TYPE_TOSHIBA)) {
|
(kbd->type == KBD_TYPE_HYUNDAI) || (kbd->type == KBD_TYPE_COMPAQ) ||
|
||||||
|
(kbd->type == KBD_TYPE_TOSHIBA)) {
|
||||||
switch (mem_size) {
|
switch (mem_size) {
|
||||||
case 256:
|
case 256:
|
||||||
kbd->pd |= 0x00;
|
kbd->pd |= 0x00;
|
||||||
@@ -1076,6 +1080,20 @@ const device_t keyboard_xt_zenith_device = {
|
|||||||
.config = NULL
|
.config = NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const device_t keyboard_xt_hyundai_device = {
|
||||||
|
.name = "Hyundai XT Keyboard",
|
||||||
|
.internal_name = "keyboard_x_hyundai",
|
||||||
|
.flags = 0,
|
||||||
|
.local = KBD_TYPE_HYUNDAI,
|
||||||
|
.init = kbd_init,
|
||||||
|
.close = kbd_close,
|
||||||
|
.reset = kbd_reset,
|
||||||
|
{ .available = NULL },
|
||||||
|
.speed_changed = NULL,
|
||||||
|
.force_redraw = NULL,
|
||||||
|
.config = NULL
|
||||||
|
};
|
||||||
|
|
||||||
const device_t keyboard_xtclone_device = {
|
const device_t keyboard_xtclone_device = {
|
||||||
.name = "XT (Clone) Keyboard",
|
.name = "XT (Clone) Keyboard",
|
||||||
.internal_name = "keyboard_xtclone",
|
.internal_name = "keyboard_xtclone",
|
||||||
|
@@ -226,6 +226,7 @@ extern const device_t keyboard_xt_lxt3_device;
|
|||||||
# endif /*defined(DEV_BRANCH) && defined(USE_LASERXT) */
|
# endif /*defined(DEV_BRANCH) && defined(USE_LASERXT) */
|
||||||
extern const device_t keyboard_xt_olivetti_device;
|
extern const device_t keyboard_xt_olivetti_device;
|
||||||
extern const device_t keyboard_xt_zenith_device;
|
extern const device_t keyboard_xt_zenith_device;
|
||||||
|
extern const device_t keyboard_xt_hyundai_device;
|
||||||
extern const device_t keyboard_xtclone_device;
|
extern const device_t keyboard_xtclone_device;
|
||||||
extern const device_t keyboard_at_device;
|
extern const device_t keyboard_at_device;
|
||||||
extern const device_t keyboard_at_siemens_device;
|
extern const device_t keyboard_at_siemens_device;
|
||||||
|
@@ -493,6 +493,14 @@ machine_xt_vendex_init(const machine_t *model)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
machine_xt_hyundai_common_init(const machine_t *model)
|
||||||
|
{
|
||||||
|
device_add(&keyboard_xt_hyundai_device);
|
||||||
|
|
||||||
|
machine_xt_common_init(model);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
machine_xt_super16t_init(const machine_t *model)
|
machine_xt_super16t_init(const machine_t *model)
|
||||||
{
|
{
|
||||||
@@ -504,7 +512,7 @@ machine_xt_super16t_init(const machine_t *model)
|
|||||||
if (bios_only || !ret)
|
if (bios_only || !ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
machine_xt_clone_init(model);
|
machine_xt_hyundai_common_init(model);
|
||||||
|
|
||||||
/* On-board FDC cannot be disabled */
|
/* On-board FDC cannot be disabled */
|
||||||
device_add(&fdc_xt_device);
|
device_add(&fdc_xt_device);
|
||||||
@@ -523,7 +531,7 @@ machine_xt_super16te_init(const machine_t *model)
|
|||||||
if (bios_only || !ret)
|
if (bios_only || !ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
machine_xt_clone_init(model);
|
machine_xt_hyundai_common_init(model);
|
||||||
|
|
||||||
/* On-board FDC cannot be disabled */
|
/* On-board FDC cannot be disabled */
|
||||||
device_add(&fdc_xt_device);
|
device_add(&fdc_xt_device);
|
||||||
|
Reference in New Issue
Block a user