Added the option to force constant mouse updating.

This commit is contained in:
OBattler
2025-08-19 21:03:09 +02:00
parent ed4b90ebf4
commit 58d3073775
32 changed files with 639 additions and 89 deletions

View File

@@ -211,6 +211,7 @@ int video_fullscreen_scale_maximized = 0; /* (C) Whether
also apply when maximized. */
int do_auto_pause = 0; /* (C) Auto-pause the emulator on focus
loss */
int force_constant_mouse = 0; /* (C) Forst constant updating of the mouse */
int hook_enabled = 1; /* (C) Keyboard hook is enabled */
int test_mode = 0; /* (C) Test mode */
char uuid[MAX_UUID_LEN] = { '\0' }; /* (C) UUID or machine identifier */

View File

@@ -224,6 +224,7 @@ load_general(void)
}
do_auto_pause = ini_section_get_int(cat, "do_auto_pause", 0);
force_constant_mouse = ini_section_get_int(cat, "force_constant_mouse", 0);
p = ini_section_get_string(cat, "uuid", NULL);
if (p != NULL)
@@ -2047,6 +2048,7 @@ config_load(void)
machine = machine_get_machine_from_internal_name("ibmpc");
dpi_scale = 1;
do_auto_pause = 0;
force_constant_mouse = 0;
cpu_override_interpreter = 0;
@@ -2326,6 +2328,11 @@ save_general(void)
else
ini_section_delete_var(cat, "do_auto_pause");
if (force_constant_mouse)
ini_section_set_int(cat, "force_constant_mouse", force_constant_mouse);
else
ini_section_delete_var(cat, "force_constant_mouse");
char cpu_buf[128] = { 0 };
plat_get_cpu_string(cpu_buf, 128);
ini_section_set_string(cat, "host_cpu", cpu_buf);

View File

@@ -82,6 +82,11 @@
#define KBC_VEN_SIEMENS 0x2c
#define KBC_VEN_COMPAQ 0x30
#define KBC_VEN_IBM 0x34
#define KBC_VEN_AWARD 0x38
#define KBC_VEN_VIA 0x3c
#define KBC_VEN_CHIPS 0x40
#define KBC_VEN_HOLTEK 0x44
#define KBC_VEN_UMC 0x48
#define KBC_VEN_MASK 0x7c
#define KBC_FLAG_IS_ASIC 0x80000000
@@ -170,6 +175,10 @@ kbc_at_port_t *kbc_at_ports[2] = { NULL, NULL };
static uint8_t kbc_ami_revision = '8';
static uint8_t kbc_award_revision = 0x42;
static uint8_t kbc_chips_revision = 0xa6;
static uint16_t kbc_phoenix_version = 0x0416;
static void (*kbc_at_do_poll)(atkbc_t *dev);
/* Non-translated to translated scan codes. */
@@ -391,6 +400,7 @@ kbc_send_to_ob(atkbc_t *dev, uint8_t val, uint8_t channel, uint8_t stat_hi)
return;
if ((kbc_ven == KBC_VEN_AMI) || (kbc_ven == KBC_VEN_TRIGEM_AMI) ||
(kbc_ven == KBC_VEN_HOLTEK) || (kbc_ven == KBC_VEN_UMC) ||
(dev->misc_flags & FLAG_PS2))
stat_hi |= ((dev->p1 & 0x80) ? 0x10 : 0x00);
else
@@ -945,6 +955,26 @@ pulse_poll(void *priv)
write_p2(dev, dev->p2 | dev->old_p2);
}
static uint8_t
write_cmd_acer(void *priv, uint8_t val)
{
atkbc_t *dev = (atkbc_t *) priv;
uint8_t ret = 1;
switch (val) {
default:
break;
case 0xaf:
kbc_at_log("ATkbc: ??? - appears in the probes of the real controller\n");
kbc_delay_to_ob(dev, 0x00, 0, 0x00);
ret = 0;
break;
}
return ret;
}
static uint8_t
write_cmd_data_ami(void *priv, uint8_t val)
{
@@ -1216,6 +1246,12 @@ write_cmd_ami(void *priv, uint8_t val)
ret = 0;
break;
case 0xca: /* read keyboard mode */
kbc_at_log("ATkbc: AMI - read keyboard mode\n");
kbc_delay_to_ob(dev, dev->ami_flags, 0, 0x00);
ret = 0;
break;
case 0xcb: /* set keyboard mode */
kbc_at_log("ATkbc: AMI - set keyboard mode\n");
dev->wantdata = 1;
@@ -1249,6 +1285,278 @@ write_cmd_ami(void *priv, uint8_t val)
return ret;
}
static uint8_t
write_cmd_umc(void *priv, uint8_t val)
{
atkbc_t *dev = (atkbc_t *) priv;
uint8_t ret = 1;
switch (val) {
default:
break;
case 0xa0: /* copyright message */
kbc_at_queue_add(dev, 0x28);
kbc_at_queue_add(dev, 0x28);
kbc_at_queue_add(dev, 0x28);
kbc_at_queue_add(dev, 0x00);
ret = 0;
break;
case 0xa1: /* get controller version */
kbc_at_log("ATkbc: UMC - get controller version\n");
kbc_delay_to_ob(dev, kbc_ami_revision, 0, 0x00);
ret = 0;
break;
}
return ret;
}
static uint8_t
write_cmd_data_award(void *priv, uint8_t val)
{
atkbc_t *dev = (atkbc_t *) priv;
uint8_t ret = 1;
switch (val) {
default:
break;
case 0xcb: /* set keyboard mode */
kbc_at_log("ATkbc: AMI - set keyboard mode\n");
dev->ami_flags = val;
dev->misc_flags &= ~FLAG_PS2;
if (val & 0x01) {
kbc_at_log("ATkbc: AMI: Emulate PS/2 keyboard\n");
dev->misc_flags |= FLAG_PS2;
kbc_at_do_poll = kbc_at_poll_ps2;
} else {
kbc_at_log("ATkbc: AMI: Emulate AT keyboard\n");
kbc_at_do_poll = kbc_at_poll_at;
}
ret = 0;
break;
}
return ret;
}
static uint8_t
write_cmd_award(void *priv, uint8_t val)
{
atkbc_t *dev = (atkbc_t *) priv;
uint8_t ret = 1;
switch (val) {
default:
break;
case 0x90 ... 0x9f: /* Write low nibble to (Port13-Port10) */
kbc_at_log("ATkbc: Award - write low nibble to (Port13-Port10)\n");
dev->p1 = (dev->p1 & 0xf0) | (val & 0x0f);
ret = 0;
break;
case 0xa1: /* get controller version */
kbc_at_log("ATkbc: AMI - get controller version\n");
kbc_delay_to_ob(dev, kbc_ami_revision, 0, 0x00);
ret = 0;
break;
case 0xa4: /* check if password installed */
kbc_at_log("ATkbc: check if password installed\n");
kbc_delay_to_ob(dev, 0xf1, 0, 0x00);
ret = 0;
break;
case 0xa5: /* do nothing */
kbc_at_log("ATkbc: do nothing\n");
ret = 0;
break;
/* TODO: Make this command do nothing on the Regional HT6542,
or else, Efflixi's Award OPTi 495 BIOS gets a stuck key
in Norton Commander 3.0. */
case 0xaf: /* read keyboard version */
kbc_at_log("ATkbc: read keyboard version\n");
kbc_delay_to_ob(dev, kbc_award_revision, 0, 0x00);
ret = 0;
break;
case 0xb0 ... 0xb3:
/* set KBC lines P10-P13 (P1 bits 0-3) low */
kbc_at_log("ATkbc: set KBC lines P10-P13 (P1 bits 0-3) low\n");
dev->p1 &= ~(1 << (val & 0x03));
kbc_delay_to_ob(dev, dev->ob, 0, 0x00);
ret = 0;
break;
/* TODO: The ICS SB486PV sends command B4 but expects to read *TWO* bytes. */
case 0xb4: case 0xb5:
/* set KBC lines P22-P23 (P2 bits 2-3) low */
kbc_at_log("ATkbc: set KBC lines P22-P23 (P2 bits 2-3) low\n");
write_p2(dev, dev->p2 & ~(4 << (val & 0x01)));
kbc_delay_to_ob(dev, dev->ob, 0, 0x00);
ret = 0;
break;
case 0xb6 ... 0xb7:
/* set KBC lines P14-P15 (P1 bits 4-5) low */
kbc_at_log("ATkbc: set KBC lines P14-P15 (P1 bits 4-5) low\n");
dev->p1 &= ~(0x10 << (val & 0x01));
kbc_delay_to_ob(dev, dev->ob, 0, 0x00);
ret = 0;
break;
case 0xb8 ... 0xbb:
/* set KBC lines P10-P13 (P1 bits 0-3) high */
kbc_at_log("ATkbc: set KBC lines P10-P13 (P1 bits 0-3) high\n");
dev->p1 |= (1 << (val & 0x03));
kbc_delay_to_ob(dev, dev->ob, 0, 0x00);
ret = 0;
break;
case 0xbc: case 0xbd:
/* set KBC lines P22-P23 (P2 bits 2-3) high */
kbc_at_log("ATkbc: set KBC lines P22-P23 (P2 bits 2-3) high\n");
write_p2(dev, dev->p2 | (4 << (val & 0x01)));
kbc_delay_to_ob(dev, dev->ob, 0, 0x00);
ret = 0;
break;
case 0xbe ... 0xbf:
/* set KBC lines P14-P15 (P1 bits 4-5) high */
kbc_at_log("ATkbc: set KBC lines P14-P15 (P1 bits 4-5) high\n");
dev->p1 |= (0x10 << (val & 0x01));
kbc_delay_to_ob(dev, dev->ob, 0, 0x00);
ret = 0;
break;
case 0xc8:
/*
* unblock KBC lines P22/P23
* (allow command D1 to change bits 2/3 of P2)
*/
kbc_at_log("ATkbc: AMI - unblock KBC lines P22 and P23\n");
dev->ami_flags &= 0xfb;
ret = 0;
break;
case 0xc9:
/*
* block KBC lines P22/P23
* (disallow command D1 from changing bits 2/3 of the port)
*/
kbc_at_log("ATkbc: AMI - block KBC lines P22 and P23\n");
dev->ami_flags |= 0x04;
ret = 0;
break;
case 0xca: /* read keyboard mode */
kbc_at_log("ATkbc: AMI - read keyboard mode\n");
kbc_delay_to_ob(dev, dev->ami_flags, 0, 0x00);
ret = 0;
break;
case 0xcb: /* set keyboard mode */
kbc_at_log("ATkbc: AMI - set keyboard mode\n");
dev->wantdata = 1;
dev->state = STATE_KBC_PARAM;
ret = 0;
break;
case 0xe1 ... 0xef: /* Active output ports */
kbc_at_log("ATkbc: Award - active output ports\n");
write_p2(dev, (dev->p2 & 0xf1) | (val & 0x0e));
ret = 0;
break;
}
return ret;
}
static uint8_t
write_cmd_data_chips(void *priv, uint8_t val)
{
atkbc_t *dev = (atkbc_t *) priv;
uint8_t ret = 1;
switch (val) {
default:
break;
case 0xa1: /* CHIPS extensions */
kbc_at_log("ATkbc: C&T - CHIPS extensions\n");
if (dev->command_phase == 1) {
switch (val) {
default:
break;
case 0x00: /* return ID */
kbc_at_log("ATkbc: C&T - return ID\n");
kbc_delay_to_ob(dev, kbc_chips_revision, 0, 0x00);
break;
case 0x02: /* write input port */
kbc_at_log("ATkbc: C&T - write input port\n");
dev->mem_addr = val;
dev->wantdata = 1;
dev->state = STATE_KBC_PARAM;
dev->command_phase = 2;
break;
case 0x04: /* select turbo switch input */
kbc_at_log("ATkbc: C&T - select turbo switch input\n");
dev->mem_addr = val;
dev->wantdata = 1;
dev->state = STATE_KBC_PARAM;
dev->command_phase = 2;
break;
case 0x05: /* select turbo LED output */
kbc_at_log("ATkbc: Cselect turbo LED output\n");
dev->mem_addr = val;
dev->wantdata = 1;
dev->state = STATE_KBC_PARAM;
dev->command_phase = 2;
break;
}
} else if (dev->command_phase == 2) {
switch (dev->mem_addr) {
default:
break;
case 0x02: /* write input port */
kbc_at_log("ATkbc: C&T - write iput port\n");
dev->p1 = val;
break;
}
dev->command_phase = 0;
}
ret = 0;
break;
}
return ret;
}
static uint8_t
write_cmd_chips(void *priv, uint8_t val)
{
atkbc_t *dev = (atkbc_t *) priv;
uint8_t ret = 1;
switch (val) {
default:
break;
case 0xa1: /* CHIPS extensions */
kbc_at_log("ATkbc: C&T - CHIPS extensions\n");
dev->wantdata = 1;
dev->state = STATE_KBC_PARAM;
ret = 0;
break;
}
return ret;
}
static uint8_t
write_cmd_data_phoenix(void *priv, uint8_t val)
{
@@ -1452,18 +1760,8 @@ write_cmd_phoenix(void *priv, uint8_t val)
revision level and proper CPU bits. */
case 0xd5: /* Read MultiKey code revision level */
kbc_at_log("ATkbc: Phoenix - Read MultiKey code revision level\n");
if (dev->misc_flags & FLAG_PS2) {
if (dev->flags & DEVICE_PCI) {
kbc_at_queue_add(dev, 0x04);
kbc_at_queue_add(dev, 0x16);
} else {
kbc_at_queue_add(dev, 0x01);
kbc_at_queue_add(dev, 0x38);
}
} else {
kbc_at_queue_add(dev, 0x01);
kbc_at_queue_add(dev, 0x29);
}
kbc_at_queue_add(dev, kbc_phoenix_version >> 8);
kbc_at_queue_add(dev, kbc_phoenix_version & 0xff);
ret = 0;
break;
@@ -1496,44 +1794,18 @@ write_cmd_phoenix(void *priv, uint8_t val)
}
ret = 0;
break;
}
return ret;
}
static uint8_t
write_cmd_siemens(void *priv, uint8_t val)
{
atkbc_t *dev = (atkbc_t *) priv;
uint8_t ret = 1;
switch (val) {
default:
ret = write_cmd_ami(dev, val);
break;
case 0x92: /*Siemens Award - 92 sent by PCD-2L BIOS*/
kbc_at_log("Siemens Award - 92 sent by PCD-2L BIOS\n");
ret = 0;
break;
case 0x94: /*Siemens Award - 94 sent by PCD-2L BIOS*/
kbc_at_log("Siemens Award - 94 sent by PCD-2L BIOS\n");
ret = 0;
break;
case 0x9a: /*Siemens Award - 9A sent by PCD-2L BIOS*/
kbc_at_log("Siemens Award - 9A sent by PCD-2L BIOS\n");
ret = 0;
break;
case 0x9c: /*Siemens Award - 9C sent by PCD-2L BIOS*/
kbc_at_log("Siemens Award - 9C sent by PCD-2L BIOS\n");
ret = 0;
break;
case 0xa9: /*Siemens Award - A9 sent by PCD-2L BIOS*/
kbc_at_log("Siemens Award - A9 sent by PCD-2L BIOS\n");
/* NOTE: The MultiKey/42i reference does not document these at all.
The ADI 386SX BIOS uses these commands but it also uses
commands B8 and BB with a parameters, which clearly indicates a
Phoenix KBC. So either these are undocumented or were present
in an early Phoenix MultiKey variant but later removed - the
MultiKey/42i reference does say a number of features were
removed, so these may have been among them, and we have no
earlier MultiKey reference to look at. */
case 0xe1 ... 0xef: /* Active output ports */
kbc_at_log("ATkbc: Phoenix - active output ports\n");
write_p2(dev, (dev->p2 & 0xf1) | (val & 0x0e));
ret = 0;
break;
}
@@ -2091,14 +2363,6 @@ kbc_at_process_cmd(void *priv)
set_enable_kbd(dev, 1);
break;
/* TODO: Make this command do nothing on the Regional HT6542,
or else, Efflixi's Award OPTi 495 BIOS gets a stuck key
in Norton Commander 3.0. */
case 0xaf: /* read keyboard version */
kbc_at_log("ATkbc: read keyboard version\n");
kbc_delay_to_ob(dev, kbc_award_revision, 0, 0x00);
break;
case 0xc0: /* read P1 */
kbc_at_log("ATkbc: read P1\n");
kbc_delay_to_ob(dev, read_p1(dev), 0, 0x00);
@@ -2120,11 +2384,6 @@ kbc_at_process_cmd(void *priv)
}
break;
case 0xca: /* read keyboard mode */
kbc_at_log("ATkbc: AMI - read keyboard mode\n");
kbc_delay_to_ob(dev, dev->ami_flags, 0, 0x00);
break;
case 0xd0: /* read P2 */
kbc_at_log("ATkbc: read P2\n");
mask = 0xff;
@@ -2579,15 +2838,27 @@ kbc_at_init(const device_t *info)
kbc_ami_revision = '8';
kbc_award_revision = 0x42;
kbc_chips_revision = 0xa6;
kbc_phoenix_version = 0x0416;
switch (dev->flags & KBC_VEN_MASK) {
default:
break;
case KBC_VEN_SIEMENS:
kbc_ami_revision = '8';
kbc_award_revision = 0x42;
dev->write_cmd_data_ven = write_cmd_data_ami;
dev->write_cmd_ven = write_cmd_siemens;
case KBC_VEN_AWARD:
case KBC_VEN_VIA:
if ((info->local & 0xff00) != 0x0000)
kbc_ami_revision = (info->local >> 8) & 0xff;
if ((info->local & 0xff0000) != 0x000000)
kbc_award_revision = (info->local >> 16) & 0xff;
dev->write_cmd_data_ven = write_cmd_data_award;
dev->write_cmd_ven = write_cmd_award;
break;
case KBC_VEN_ACER:
dev->write_cmd_ven = write_cmd_acer;
break;
case KBC_VEN_OLIVETTI:
@@ -2608,7 +2879,10 @@ kbc_at_init(const device_t *info)
break;
case KBC_VEN_AMI:
if ((dev->flags & KBC_TYPE_MASK) == KBC_TYPE_GREEN)
case KBC_VEN_HOLTEK:
if ((info->local & 0xff00) != 0x0000)
kbc_ami_revision = (info->local >> 8) & 0xff;
else if ((dev->flags & KBC_TYPE_MASK) == KBC_TYPE_GREEN)
kbc_ami_revision = '5';
else if ((dev->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1) {
if (cpu_64bitbus)
@@ -2631,7 +2905,25 @@ kbc_at_init(const device_t *info)
dev->write_cmd_ven = write_cmd_ami;
break;
case KBC_VEN_UMC:
if ((info->local & 0xff00) != 0x0000)
kbc_ami_revision = (info->local >> 8) & 0xff;
else
kbc_ami_revision = 0x48;
dev->write_cmd_ven = write_cmd_umc;
break;
case KBC_VEN_CHIPS:
if ((info->local & 0xff00) != 0x0000)
kbc_chips_revision = (info->local >> 8) & 0xff;
dev->write_cmd_data_ven = write_cmd_data_chips;
dev->write_cmd_ven = write_cmd_chips;
break;
case KBC_VEN_PHOENIX:
if ((info->local & 0xffff00) != 0x000000)
kbc_phoenix_version = (info->local >> 8) & 0xffff;
dev->write_cmd_data_ven = write_cmd_data_phoenix;
dev->write_cmd_ven = write_cmd_phoenix;
break;
@@ -2721,6 +3013,76 @@ const device_t kbc_at_ami_device = {
.config = NULL
};
const device_t kbc_at_holtek_device = {
.name = "PC/AT Keyboard (Holtek)",
.internal_name = "keyboard_at_holtek",
.flags = DEVICE_KBC,
.local = KBC_TYPE_ISA | KBC_VEN_HOLTEK | KBC_FLAG_IS_ASIC,
.init = kbc_at_init,
.close = kbc_at_close,
.reset = kbc_at_reset,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t kbc_at_umc_device = {
.name = "PC/AT Keyboard (UMC)",
.internal_name = "keyboard_at_umc",
.flags = DEVICE_KBC,
.local = KBC_TYPE_ISA | KBC_VEN_UMC | KBC_FLAG_IS_ASIC,
.init = kbc_at_init,
.close = kbc_at_close,
.reset = kbc_at_reset,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t kbc_at_award_device = {
.name = "PC/AT Keyboard (Award)",
.internal_name = "keyboard_at_award",
.flags = DEVICE_KBC,
.local = KBC_TYPE_ISA | KBC_VEN_AWARD,
.init = kbc_at_init,
.close = kbc_at_close,
.reset = kbc_at_reset,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t kbc_at_chips_device = {
.name = "PC/AT Keyboard (C&T)",
.internal_name = "keyboard_at_chips",
.flags = DEVICE_KBC,
.local = KBC_TYPE_ISA | KBC_VEN_CHIPS,
.init = kbc_at_init,
.close = kbc_at_close,
.reset = kbc_at_reset,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t kbc_at_quadtel_device = {
.name = "PC/AT Keyboard (Quadtel)",
.internal_name = "keyboard_at_quadtel",
.flags = DEVICE_KBC,
.local = KBC_TYPE_ISA | KBC_VEN_QUADTEL,
.init = kbc_at_init,
.close = kbc_at_close,
.reset = kbc_at_reset,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t kbc_at_tg_ami_device = {
.name = "PC/AT Keyboard Controller (TriGem AMI)",
.internal_name = "kbc_at_tg_ami",
@@ -2777,6 +3139,20 @@ const device_t kbc_at_ncr_device = {
.config = NULL
};
const device_t kbc_at_via_device = {
.name = "PC/AT Keyboard (VIA)",
.internal_name = "keyboard_at_via",
.flags = DEVICE_KBC,
.local = KBC_TYPE_ISA | KBC_VEN_VIA | KBC_FLAG_IS_ASIC,
.init = kbc_at_init,
.close = kbc_at_close,
.reset = kbc_at_reset,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t kbc_at_compaq_device = {
.name = "PC/AT Keyboard Controller (Compaq)",
.internal_name = "kbc_at_compaq",
@@ -2861,6 +3237,20 @@ const device_t kbc_ps2_xi8088_device = {
.config = NULL
};
const device_t kbc_ps2_acer_device = {
.name = "PS/2 Keyboard (Acer 90M002A)",
.internal_name = "keyboard_ps2_acer_pci",
.flags = DEVICE_KBC,
.local = KBC_TYPE_PS2_1 | KBC_VEN_ACER,
.init = kbc_at_init,
.close = kbc_at_close,
.reset = kbc_at_reset,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t kbc_ps2_ami_device = {
.name = "PS/2 Keyboard Controller (AMI)",
.internal_name = "kbc_ps2_ami",
@@ -2893,7 +3283,50 @@ const device_t kbc_ps2_holtek_device = {
.name = "PS/2 Keyboard Controller (Holtek)",
.internal_name = "kbc_ps2_holtek",
.flags = DEVICE_KBC,
.local = KBC_TYPE_PS2_1 | KBC_VEN_AMI | KBC_FLAG_IS_ASIC,
.local = KBC_TYPE_PS2_1 | KBC_VEN_HOLTEK | KBC_FLAG_IS_ASIC,
.init = kbc_at_init,
.close = kbc_at_close,
.reset = kbc_at_reset,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t kbc_ps2_umc_device = {
.name = "PS/2 Keyboard (UMC)",
.internal_name = "keyboard_ps2_umc",
.flags = DEVICE_KBC,
.local = KBC_TYPE_PS2_1 | KBC_VEN_UMC | KBC_FLAG_IS_ASIC,
.init = kbc_at_init,
.close = kbc_at_close,
.reset = kbc_at_reset,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t kbc_ps2_award_device = {
.name = "PS/2 Keyboard (Award)",
.internal_name = "keyboard_ps2_award",
.flags = DEVICE_KBC,
.local = KBC_TYPE_PS2_1 | KBC_VEN_AWARD,
.init = kbc_at_init,
.close = kbc_at_close,
.reset = kbc_at_reset,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t kbc_ps2_via_device = {
.name = "PS/2 Keyboard (VIA)",
.internal_name = "keyboard_ps2_via",
.flags = DEVICE_KBC,
.local = KBC_TYPE_PS2_1 | KBC_VEN_VIA | KBC_FLAG_IS_ASIC,
.init = kbc_at_init,
.close = kbc_at_close,
.reset = kbc_at_reset,

View File

@@ -559,7 +559,7 @@ mouse_get_buttons_ex(void)
void
mouse_set_sample_rate(double new_rate)
{
mouse_timed = (new_rate > 0.0);
mouse_timed = !force_constant_mouse && (new_rate > 0.0);
timer_stop(&mouse_timer);
@@ -568,6 +568,12 @@ mouse_set_sample_rate(double new_rate)
timer_on_auto(&mouse_timer, 1000000.0 / sample_rate);
}
void
mouse_update_sample_rate(void)
{
mouse_set_sample_rate(sample_rate);
}
/* Callback from the hardware driver. */
void
mouse_set_buttons(int buttons)

View File

@@ -171,6 +171,7 @@ extern int fixed_size_y;
extern int sound_muted; /* (C) Is sound muted? */
extern int do_auto_pause; /* (C) Auto-pause the emulator on focus loss */
extern int auto_paused;
extern int force_constant_mouse; /* (C) Forst constant updating of the mouse */
extern double mouse_sensitivity; /* (C) Mouse sensitivity scale */
#ifdef _Atomic
extern _Atomic double mouse_x_error; /* Mouse error accumulator - Y */

View File

@@ -258,7 +258,14 @@ extern const device_t kbc_xt_fe2010_device;
extern const device_t kbc_xtclone_device;
extern const device_t kbc_at_device;
extern const device_t kbc_at_ami_device;
extern const device_t kbc_at_award_device;
extern const device_t kbc_at_chips_device;
extern const device_t kbc_at_holtek_device;
extern const device_t kbc_at_phoenix_device;
extern const device_t kbc_at_quadtel_device;
extern const device_t kbc_at_compaq_device;
extern const device_t kbc_at_umc_device;
extern const device_t kbc_at_via_device;
extern const device_t kbc_at_phoenix_device;
extern const device_t kbc_at_ncr_device;
extern const device_t kbc_at_olivetti_device;
@@ -269,7 +276,9 @@ extern const device_t kbc_ps2_device;
extern const device_t kbc_ps2_ps1_device;
extern const device_t kbc_ps2_ps1_pci_device;
extern const device_t kbc_ps2_xi8088_device;
extern const device_t kbc_ps2_acer_device;
extern const device_t kbc_ps2_ami_device;
extern const device_t kbc_ps2_award_device;
extern const device_t kbc_ps2_compaq_device;
extern const device_t kbc_ps2_holtek_device;
extern const device_t kbc_ps2_mca_1_device;
@@ -277,6 +286,8 @@ extern const device_t kbc_ps2_mca_2_device;
extern const device_t kbc_ps2_olivetti_device;
extern const device_t kbc_ps2_phoenix_device;
extern const device_t kbc_ps2_quadtel_device;
extern const device_t kbc_ps2_umc_device;
extern const device_t kbc_ps2_via_device;
extern const device_t kbc_ps2_tg_ami_device;
extern const device_t kbc_ps2_tg_ami_green_device;
extern const device_t kbc_ps2_pci_device;

View File

@@ -114,6 +114,7 @@ extern void mouse_subtract_w(int *delta_w, int min, int max, int inve
extern void mouse_set_buttons_ex(int b);
extern int mouse_get_buttons_ex(void);
extern void mouse_set_sample_rate(double new_rate);
extern void mouse_update_sample_rate(void);
extern void mouse_set_buttons(int buttons);
extern void mouse_get_abs_coords(double *x_abs, double *y_abs);
extern void mouse_process(void);

View File

@@ -2933,3 +2933,6 @@ msgstr ""
msgid "The system will not be added."
msgstr ""
msgid "&Update mouse every CPU frame"
msgstr ""

View File

@@ -2933,3 +2933,6 @@ msgstr "Systém nebude přidán."
msgid "%1 Hz"
msgstr "%1 Hz"
msgid "&Update mouse every CPU frame"
msgstr "&Aktualizovat myš při každém rámce CPU"

View File

@@ -2934,6 +2934,9 @@ msgstr "Der Prozess der virtuellen Maschine \"%1\" wurde unerwartet mit dem Exit
msgid "The system will not be added."
msgstr "Das System wird nicht hinzugefügt werden."
msgid "&Update mouse every CPU frame"
msgstr "&Maus bei jedem CPU-Frame aktualisieren"
#~ msgid "HD Controller:"
#~ msgstr "Festplatten-Controller:"

View File

@@ -2934,6 +2934,9 @@ msgstr "El proceso de la máquina virtual \"%1\" terminó inesperadamente con el
msgid "The system will not be added."
msgstr "El sistema no será añadido."
msgid "&Update mouse every CPU frame"
msgstr "&Actualiza el estado del ratón en cada bloco de CPU"
#~ msgid "HD Controller:"
#~ msgstr "Controladora HD:"

View File

@@ -400,7 +400,7 @@ msgid "Dynamic Recompiler"
msgstr "Recompilateur dynamique"
msgid "CPU frame size"
msgstr "Taille du bloc de CPU"
msgstr "Taille du bloc de processeur"
msgid "Larger frames (less smooth)"
msgstr "Blocs plus grands (moins fluid)"
@@ -2934,6 +2934,9 @@ msgstr "Le processus de la machine virtuelle \"%1\" s'est arrêté de manière i
msgid "The system will not be added."
msgstr "Le système ne sera pas ajouté."
msgid "&Update mouse every CPU frame"
msgstr "&Mettre à jour le statut du souris en qualquier bloc de processeur"
#~ msgid "HD Controller:"
#~ msgstr "Contrôleur HD:"

View File

@@ -2934,6 +2934,9 @@ msgstr "Proces virtualnog sistema \"%1\" neočekivano je završio s izlaznim kod
msgid "The system will not be added."
msgstr "Sistem neće biti dodan."
msgid "&Update mouse every CPU frame"
msgstr "&Ažuriraj status miša kod skavog bloka procesora"
#~ msgid "HD Controller:"
#~ msgstr "Kontroler tvrdog diska:"

View File

@@ -400,13 +400,13 @@ msgid "Dynamic Recompiler"
msgstr "Ricompilatore dinamico"
msgid "CPU frame size"
msgstr "Dimensione fotogrammi CPU"
msgstr "Dimensione blocchi CPU"
msgid "Larger frames (less smooth)"
msgstr "Fotogrammi più grandi (meno fluido)"
msgstr "Blocchi più grandi (meno fluido)"
msgid "Smaller frames (smoother)"
msgstr "Fotogrammi più piccoli (più fluido)"
msgstr "Blocchi più piccoli (più fluido)"
msgid "Video:"
msgstr "Video:"
@@ -2934,6 +2934,9 @@ msgstr "Il processo della macchina virtuale \"%1\" è terminato inaspettatamente
msgid "The system will not be added."
msgstr "Il sistema non verrà aggiunto."
msgid "&Update mouse every CPU frame"
msgstr "&Aggiorano stato mouse ad ogni blocco CPU"
#~ msgid "HD Controller:"
#~ msgstr "Controller HD:"

View File

@@ -2934,6 +2934,9 @@ msgstr "仮想マシン\"%1\"のプロセスが、終了コード %2 で予期
msgid "The system will not be added."
msgstr "システムは追加されません。"
msgid "&Update mouse every CPU frame"
msgstr "マウスをCPUフレームごとに更新(&U)"
#~ msgid "HD Controller:"
#~ msgstr "HDDコントローラー:"

View File

@@ -2934,6 +2934,9 @@ msgstr ""
msgid "The system will not be added."
msgstr ""
msgid "&Update mouse every CPU frame"
msgstr ""
#~ msgid "HD Controller:"
#~ msgstr "HD 컨트롤러:"

View File

@@ -2934,6 +2934,9 @@ msgstr "Het proces van de virtuele machine \"%1\" is onverwacht beëindigd met e
msgid "The system will not be added."
msgstr "Het systeem wordt niet toegevoegd."
msgid "&Update mouse every CPU frame"
msgstr "&Muis bijwerken bij elk CPU-frame"
#~ msgid "HD Controller:"
#~ msgstr "HD-controller:"

View File

@@ -2933,3 +2933,6 @@ msgstr ""
msgid "The system will not be added."
msgstr ""
msgid "&Update mouse every CPU frame"
msgstr ""

View File

@@ -2933,3 +2933,6 @@ msgstr "O processo da máquina virtual \"%1\" terminou inesperadamente com o có
msgid "The system will not be added."
msgstr "O sistema não será adicionado."
msgid "&Update mouse every CPU frame"
msgstr "&Atualiza o estado do mouse em cada quadro do CPU"

View File

@@ -2934,6 +2934,9 @@ msgstr "O processo da máquina virtual \"%1\" terminou inesperadamente com o có
msgid "The system will not be added."
msgstr "O sistema não será adicionado."
msgid "&Update mouse every CPU frame"
msgstr "&Atualiza o estado do rato em cada bloco do CPU"
#~ msgid "HD Controller:"
#~ msgstr "Controlador HD:"

View File

@@ -2934,6 +2934,9 @@ msgstr "Процесс виртуальной машины \"%1\" неожида
msgid "The system will not be added."
msgstr "Система не будет добавлена."
msgid "&Update mouse every CPU frame"
msgstr "&Обновлять мышь при каждом кадре ЦП"
#~ msgid "HD Controller:"
#~ msgstr "Контроллер HD:"

View File

@@ -2934,6 +2934,9 @@ msgstr "Systém nebude pridaný."
msgid "%1 Hz"
msgstr "%1 Hz"
msgid "&Update mouse every CPU frame"
msgstr "&Aktualizovať myš pri každom rámci CPU"
#~ msgid "HD Controller:"
#~ msgstr "Radič disku:"

View File

@@ -2934,6 +2934,9 @@ msgstr "Proces navidezne naprave \"%1\" se je nepričakovano zaključil z izhodn
msgid "The system will not be added."
msgstr "Sistem ne bo dodan."
msgid "&Update mouse every CPU frame"
msgstr "&Posodibi stanje miške ob vsakem bloku procesorja"
#~ msgid "HD Controller:"
#~ msgstr "Krmilnik trdega diska:"

View File

@@ -2934,6 +2934,9 @@ msgstr ""
msgid "The system will not be added."
msgstr ""
msgid "&Update mouse every CPU frame"
msgstr ""
#~ msgid "HD Controller:"
#~ msgstr "Styrenhet för hårddisk:"

View File

@@ -2934,6 +2934,9 @@ msgstr ""
msgid "The system will not be added."
msgstr ""
msgid "&Update mouse every CPU frame"
msgstr ""
#~ msgid "HD Controller:"
#~ msgstr "Hard Disk Denetleyicisi:"

View File

@@ -2934,6 +2934,9 @@ msgstr "Процес віртуальної машини \"%1\" несподів
msgid "The system will not be added."
msgstr "Система не буде додана."
msgid "&Update mouse every CPU frame"
msgstr "&Оновлювати мишу при кожному кадрі ЦП"
#~ msgid "HD Controller:"
#~ msgstr "Контролер HD:"

View File

@@ -2934,6 +2934,9 @@ msgstr "Tiến trình của máy ảo \"%1\" đã bị dừng bất thường v
msgid "The system will not be added."
msgstr "Hệ thống sẽ không được thêm."
msgid "&Update mouse every CPU frame"
msgstr "&Cập nhật chuột mỗi cỡ khung CPU"
#~ msgid "HD Controller:"
#~ msgstr "Bộ điều khiển ổ cứng:"

View File

@@ -2934,6 +2934,9 @@ msgstr ""
msgid "The system will not be added."
msgstr ""
msgid "&Update mouse every CPU frame"
msgstr ""
#~ msgid "HD Controller:"
#~ msgstr "硬盘控制器:"

View File

@@ -2934,6 +2934,9 @@ msgstr ""
msgid "The system will not be added."
msgstr ""
msgid "&Update mouse every CPU frame"
msgstr ""
#~ msgid "HD Controller:"
#~ msgstr "硬碟控制器:"

View File

@@ -678,6 +678,9 @@ MainWindow::MainWindow(QWidget *parent)
if (do_auto_pause > 0) {
ui->actionAuto_pause->setChecked(true);
}
if (force_constant_mouse > 0) {
ui->actionUpdate_mouse_every_CPU_frame->setChecked(true);
}
#ifdef Q_OS_MACOS
ui->actionCtrl_Alt_Del->setShortcutVisibleInContextMenu(true);
@@ -1982,6 +1985,16 @@ MainWindow::on_actionAuto_pause_triggered()
{
do_auto_pause ^= 1;
ui->actionAuto_pause->setChecked(do_auto_pause > 0 ? true : false);
config_save();
}
void
MainWindow::on_actionUpdate_mouse_every_CPU_frame_triggered()
{
force_constant_mouse ^= 1;
ui->actionUpdate_mouse_every_CPU_frame->setChecked(force_constant_mouse > 0 ? true : false);
mouse_update_sample_rate();
config_save();
}
void

View File

@@ -81,6 +81,7 @@ private slots:
void on_actionSettings_triggered();
void on_actionExit_triggered();
void on_actionAuto_pause_triggered();
void on_actionUpdate_mouse_every_CPU_frame_triggered();
void on_actionPause_triggered();
void on_actionCtrl_Alt_Del_triggered();
void on_actionCtrl_Alt_Esc_triggered();

View File

@@ -68,12 +68,14 @@
<addaction name="actionPen"/>
<addaction name="actionCursor_Puck"/>
</widget>
<addaction name="actionAuto_pause"/>
<addaction name="menuTablet_tool"/>
<addaction name="separator"/>
<addaction name="actionKeyboard_requires_capture"/>
<addaction name="actionRight_CTRL_is_left_ALT"/>
<addaction name="menuTablet_tool"/>
<addaction name="separator"/>
<addaction name="actionUpdate_mouse_every_CPU_frame"/>
<addaction name="separator"/>
<addaction name="actionAuto_pause"/>
<addaction name="actionPause"/>
<addaction name="separator"/>
<addaction name="actionHard_Reset"/>
@@ -272,6 +274,14 @@
<addaction name="separator"/>
<addaction name="actionSettings"/>
</widget>
<action name="actionUpdate_mouse_every_CPU_frame">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>&amp;Update mouse every CPU frame</string>
</property>
</action>
<action name="actionAuto_pause">
<property name="checkable">
<bool>true</bool>