Files
86Box/src/device/mouse_ps2.c

402 lines
11 KiB
C
Raw Normal View History

/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Implementation of PS/2 series Mouse devices.
*
2023-08-14 21:13:37 +02:00
* Authors: Miran Grca, <mgrca8@gmail.com>
2020-03-25 00:46:02 +02:00
*
2023-08-14 21:13:37 +02:00
* Copyright 2023 Miran Grca.
*/
#include <stdarg.h>
#include <stdatomic.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#define HAVE_STDARG_H
#include <86box/86box.h>
#include <86box/device.h>
#include <86box/keyboard.h>
#include <86box/mouse.h>
#include <86box/plat.h>
2023-06-26 12:47:04 -04:00
#include <86box/plat_unused.h>
enum {
MODE_STREAM,
MODE_REMOTE,
MODE_ECHO
};
#define FLAG_EXPLORER 0x200 /* Has 5 buttons */
#define FLAG_5BTN 0x100 /* using Intellimouse Optical mode */
#define FLAG_INTELLI 0x80 /* device is IntelliMouse */
#define FLAG_INTMODE 0x40 /* using Intellimouse mode */
#define FLAG_SCALED 0x20 /* enable delta scaling */
#define FLAG_ENABLED 0x10 /* dev is enabled for use */
#define FLAG_CTRLDAT 0x08 /* ctrl or data mode */
#define FIFO_SIZE 16
int mouse_scan = 0;
#ifdef ENABLE_MOUSE_PS2_LOG
int mouse_ps2_do_log = ENABLE_MOUSE_PS2_LOG;
static void
mouse_ps2_log(const char *fmt, ...)
{
va_list ap;
if (mouse_ps2_do_log) {
2022-09-18 17:13:28 -04:00
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
}
}
#else
2022-09-18 17:13:28 -04:00
# define mouse_ps2_log(fmt, ...)
#endif
void
mouse_clear_data(void *priv)
{
atkbc_dev_t *dev = (atkbc_dev_t *) priv;
dev->flags &= ~FLAG_CTRLDAT;
}
static void
ps2_report_coordinates(atkbc_dev_t *dev, int main)
{
2022-11-19 08:49:04 -05:00
uint8_t buff[3] = { 0x08, 0x00, 0x00 };
int delta_x;
int delta_y;
int overflow_x;
int overflow_y;
2023-08-11 22:29:53 +02:00
int b = mouse_get_buttons_ex();
int delta_z;
mouse_subtract_coords(&delta_x, &delta_y, &overflow_x, &overflow_y,
-256, 255, 1, 0);
2023-08-12 17:56:44 +02:00
mouse_subtract_z(&delta_z, -8, 7, 0);
2023-08-11 22:29:53 +02:00
buff[0] |= (overflow_y << 7) | (overflow_x << 6) |
((delta_y & 0x0100) >> 3) | ((delta_x & 0x0100) >> 4) |
2023-08-11 22:29:53 +02:00
(b & ((dev->flags & FLAG_INTELLI) ? 0x07 : 0x03));
buff[1] = (delta_x & 0x00ff);
buff[2] = (delta_y & 0x00ff);
kbc_at_dev_queue_add(dev, buff[0], main);
kbc_at_dev_queue_add(dev, buff[1], main);
kbc_at_dev_queue_add(dev, buff[2], main);
if (dev->flags & FLAG_INTMODE) {
2023-08-11 22:29:53 +02:00
delta_z &= 0x0f;
2023-05-11 03:02:36 -04:00
if (dev->flags & FLAG_5BTN) {
2023-08-11 22:29:53 +02:00
if (b & 8)
delta_z |= 0x10;
if (b & 16)
delta_z |= 0x20;
} else {
/* The wheel coordinate is sign-extended. */
2023-08-11 22:29:53 +02:00
if (delta_z & 0x08)
delta_z |= 0xf0;
}
2023-08-11 22:29:53 +02:00
kbc_at_dev_queue_add(dev, delta_z, main);
}
}
static void
ps2_set_defaults(atkbc_dev_t *dev)
{
dev->mode = MODE_STREAM;
dev->rate = 100;
mouse_set_sample_rate(100.0);
dev->resolution = 2;
dev->flags &= 0x188;
2023-04-24 02:47:17 +02:00
mouse_scan = 0;
}
static void
ps2_bat(void *priv)
{
atkbc_dev_t *dev = (atkbc_dev_t *) priv;
ps2_set_defaults(dev);
kbc_at_dev_queue_add(dev, 0xaa, 0);
kbc_at_dev_queue_add(dev, 0x00, 0);
}
static void
ps2_write(void *priv)
{
atkbc_dev_t *dev = (atkbc_dev_t *) priv;
2023-08-11 22:29:53 +02:00
int b;
2023-05-11 03:02:36 -04:00
uint8_t temp;
uint8_t val;
2023-04-20 14:28:37 +02:00
static uint8_t last_data[6] = { 0x00 };
if (dev->port == NULL)
return;
val = dev->port->dat;
dev->state = DEV_STATE_MAIN_OUT;
if (dev->flags & FLAG_CTRLDAT) {
2022-09-18 17:13:28 -04:00
dev->flags &= ~FLAG_CTRLDAT;
2022-09-18 17:13:28 -04:00
if (val == 0xff)
kbc_at_dev_reset(dev, 1);
else switch (dev->command) {
2022-09-18 17:13:28 -04:00
case 0xe8: /* set mouse resolution */
dev->resolution = val;
kbc_at_dev_queue_add(dev, 0xfa, 0);
mouse_ps2_log("%s: Set mouse resolution [%02X]\n", dev->name, val);
2022-09-18 17:13:28 -04:00
break;
2022-09-18 17:13:28 -04:00
case 0xf3: /* set sample rate */
dev->rate = val;
mouse_set_sample_rate((double) val);
kbc_at_dev_queue_add(dev, 0xfa, 0); /* Command response */
mouse_ps2_log("%s: Set sample rate [%02X]\n", dev->name, val);
2022-09-18 17:13:28 -04:00
break;
2022-09-18 17:13:28 -04:00
default:
kbc_at_dev_queue_add(dev, 0xfc, 0);
2022-09-18 17:13:28 -04:00
}
} else {
2022-09-18 17:13:28 -04:00
dev->command = val;
switch (dev->command) {
case 0xe6: /* set scaling to 1:1 */
mouse_ps2_log("%s: Set scaling to 1:1\n", dev->name);
2022-09-18 17:13:28 -04:00
dev->flags &= ~FLAG_SCALED;
kbc_at_dev_queue_add(dev, 0xfa, 0);
2022-09-18 17:13:28 -04:00
break;
case 0xe7: /* set scaling to 2:1 */
mouse_ps2_log("%s: Set scaling to 2:1\n", dev->name);
2022-09-18 17:13:28 -04:00
dev->flags |= FLAG_SCALED;
kbc_at_dev_queue_add(dev, 0xfa, 0);
2022-09-18 17:13:28 -04:00
break;
case 0xe8: /* set mouse resolution */
mouse_ps2_log("%s: Set mouse resolution\n", dev->name);
2022-09-18 17:13:28 -04:00
dev->flags |= FLAG_CTRLDAT;
kbc_at_dev_queue_add(dev, 0xfa, 0);
dev->state = DEV_STATE_MAIN_WANT_IN;
2022-09-18 17:13:28 -04:00
break;
case 0xe9: /* status request */
mouse_ps2_log("%s: Status request\n", dev->name);
2023-08-11 22:29:53 +02:00
b = mouse_get_buttons_ex();
kbc_at_dev_queue_add(dev, 0xfa, 0);
2023-04-20 14:28:37 +02:00
temp = (dev->flags & 0x20);
if (mouse_scan)
temp |= FLAG_ENABLED;
2023-08-11 22:29:53 +02:00
if (b & 1)
temp |= 4;
2023-08-11 22:29:53 +02:00
if (b & 2)
temp |= 1;
2023-08-11 22:29:53 +02:00
if ((b & 4) && (dev->flags & FLAG_INTELLI))
temp |= 2;
kbc_at_dev_queue_add(dev, temp, 0);
kbc_at_dev_queue_add(dev, dev->resolution, 0);
kbc_at_dev_queue_add(dev, dev->rate, 0);
2022-09-18 17:13:28 -04:00
break;
2023-02-08 22:11:22 +01:00
case 0xea: /* set stream */
mouse_ps2_log("%s: Set stream\n", dev->name);
2023-02-08 22:11:22 +01:00
dev->flags &= ~FLAG_CTRLDAT;
dev->mode = MODE_STREAM;
2023-02-08 22:11:22 +01:00
mouse_scan = 1;
kbc_at_dev_queue_add(dev, 0xfa, 0); /* ACK for command byte */
2023-02-08 22:11:22 +01:00
break;
2022-09-18 17:13:28 -04:00
case 0xeb: /* Get mouse data */
mouse_ps2_log("%s: Get mouse data\n", dev->name);
kbc_at_dev_queue_add(dev, 0xfa, 0);
2022-09-18 17:13:28 -04:00
ps2_report_coordinates(dev, 0);
2022-09-18 17:13:28 -04:00
break;
case 0xf0: /* set remote */
mouse_ps2_log("%s: Set remote\n", dev->name);
dev->flags &= ~FLAG_CTRLDAT;
dev->mode = MODE_REMOTE;
mouse_scan = 1;
kbc_at_dev_queue_add(dev, 0xfa, 0); /* ACK for command byte */
break;
2022-09-18 17:13:28 -04:00
case 0xf2: /* read ID */
mouse_ps2_log("%s: Read ID\n", dev->name);
kbc_at_dev_queue_add(dev, 0xfa, 0);
2022-09-18 17:13:28 -04:00
if (dev->flags & FLAG_INTMODE)
kbc_at_dev_queue_add(dev, (dev->flags & FLAG_5BTN) ? 0x04 : 0x03, 0);
2022-09-18 17:13:28 -04:00
else
kbc_at_dev_queue_add(dev, 0x00, 0);
2022-09-18 17:13:28 -04:00
break;
case 0xf3: /* set sample rate */
mouse_ps2_log("%s: Set sample rate\n", dev->name);
2022-09-18 17:13:28 -04:00
dev->flags |= FLAG_CTRLDAT;
kbc_at_dev_queue_add(dev, 0xfa, 0); /* ACK for command byte */
dev->state = DEV_STATE_MAIN_WANT_IN;
2022-09-18 17:13:28 -04:00
break;
case 0xf4: /* enable */
mouse_ps2_log("%s: Enable\n", dev->name);
2022-09-18 17:13:28 -04:00
mouse_scan = 1;
kbc_at_dev_queue_add(dev, 0xfa, 0);
2022-09-18 17:13:28 -04:00
break;
case 0xf5: /* disable */
mouse_ps2_log("%s: Disable\n", dev->name);
2022-09-18 17:13:28 -04:00
mouse_scan = 0;
kbc_at_dev_queue_add(dev, 0xfa, 0);
2022-09-18 17:13:28 -04:00
break;
case 0xf6: /* set defaults */
mouse_ps2_log("%s: Set defaults\n", dev->name);
ps2_set_defaults(dev);
kbc_at_dev_queue_add(dev, 0xfa, 0);
break;
2022-09-18 17:13:28 -04:00
case 0xff: /* reset */
mouse_ps2_log("%s: Reset\n", dev->name);
kbc_at_dev_reset(dev, 1);
2022-09-18 17:13:28 -04:00
break;
default:
kbc_at_dev_queue_add(dev, 0xfe, 0);
2022-09-18 17:13:28 -04:00
}
}
if (dev->flags & FLAG_INTELLI) {
2022-09-18 17:13:28 -04:00
for (temp = 0; temp < 5; temp++)
2023-04-20 14:28:37 +02:00
last_data[temp] = last_data[temp + 1];
2023-04-20 14:28:37 +02:00
last_data[5] = val;
2023-04-20 14:28:37 +02:00
if ((last_data[0] == 0xf3) && (last_data[1] == 0xc8) &&
(last_data[2] == 0xf3) && (last_data[3] == 0x64) &&
(last_data[4] == 0xf3) && (last_data[5] == 0x50))
2022-09-18 17:13:28 -04:00
dev->flags |= FLAG_INTMODE;
if ((dev->flags & FLAG_EXPLORER) && (dev->flags & FLAG_INTMODE) &&
2023-04-20 14:28:37 +02:00
(last_data[0] == 0xf3) && (last_data[1] == 0xc8) &&
(last_data[2] == 0xf3) && (last_data[3] == 0xc8) &&
(last_data[4] == 0xf3) && (last_data[5] == 0x50))
dev->flags |= FLAG_5BTN;
}
Applied all mainline PCem commits; Added experimental NVidia Riva TNT2 emulation (patch from MoochMcGee); ASUS P/I-P54TP4XE, ASUS P/I-P55T2P4, and ASUS P/I-P55TVP4 are back; National Semiconductor PC87306 Super I/O chip now correctly reenables devices after a chip power cycle; Several FDC improvements and the behavior is now a bit closer to real hardware (based on actual tests); Added MR Intel Advanced/ATX with Microid Research BIOS with support for 4 floppy drives and up to 4 IDE controllers; Added floppy drives 3 and 4, bringing the maximum to 4; You can now connect hard disks to the tertiary IDE controller; Correct undocumented behavior of the LEA instruction with register is back on 286 and later CPU's; Pentium-rea models with Intel chipsets now have port 92 (with alternate reset and alternate A20 toggle); Overhauled DMA channel read and write routines and fixed cascading; Improved IMG detection of a bad BPB (or complete lack of a BPB); Added preliminary emulation of PS/2 1.44 MB and PC-98 1.25 MB 3-mode drives (both have an inverted DENSEL pin); Removed the incorrect Amstrad mouse patch from TheCollector1995; Fixed ATAPI CD-ROM disk change detection; Windows IOCTL CD-ROM handler now tries to use direct SCSI passthrough for more things, including obtaining CD-ROM capacity; The Diamond Stealth32 (ET4000/W32p) now also works correctly on the two Award SiS 496/497 boxes; The (S)VGA handler now converts 6-bit RAMDAC RGB channels to standard 8-bit RGB using a lookup table generated at emulator start, calculated using the correct intensity conversion method and treating intensity 64 as equivalent to 63; Moved a few options from the Configuration dialog box to the menu; SIO, PIIX, and PIIX3 now have the reset control register on port CF9 as they should; Several bugfixes.
2016-12-23 03:16:24 +01:00
}
static int
2023-08-11 22:29:53 +02:00
ps2_poll(void *priv)
Applied all mainline PCem commits; Added experimental NVidia Riva TNT2 emulation (patch from MoochMcGee); ASUS P/I-P54TP4XE, ASUS P/I-P55T2P4, and ASUS P/I-P55TVP4 are back; National Semiconductor PC87306 Super I/O chip now correctly reenables devices after a chip power cycle; Several FDC improvements and the behavior is now a bit closer to real hardware (based on actual tests); Added MR Intel Advanced/ATX with Microid Research BIOS with support for 4 floppy drives and up to 4 IDE controllers; Added floppy drives 3 and 4, bringing the maximum to 4; You can now connect hard disks to the tertiary IDE controller; Correct undocumented behavior of the LEA instruction with register is back on 286 and later CPU's; Pentium-rea models with Intel chipsets now have port 92 (with alternate reset and alternate A20 toggle); Overhauled DMA channel read and write routines and fixed cascading; Improved IMG detection of a bad BPB (or complete lack of a BPB); Added preliminary emulation of PS/2 1.44 MB and PC-98 1.25 MB 3-mode drives (both have an inverted DENSEL pin); Removed the incorrect Amstrad mouse patch from TheCollector1995; Fixed ATAPI CD-ROM disk change detection; Windows IOCTL CD-ROM handler now tries to use direct SCSI passthrough for more things, including obtaining CD-ROM capacity; The Diamond Stealth32 (ET4000/W32p) now also works correctly on the two Award SiS 496/497 boxes; The (S)VGA handler now converts 6-bit RAMDAC RGB channels to standard 8-bit RGB using a lookup table generated at emulator start, calculated using the correct intensity conversion method and treating intensity 64 as equivalent to 63; Moved a few options from the Configuration dialog box to the menu; SIO, PIIX, and PIIX3 now have the reset control register on port CF9 as they should; Several bugfixes.
2016-12-23 03:16:24 +01:00
{
atkbc_dev_t *dev = (atkbc_dev_t *) priv;
int packet_size = (dev->flags & FLAG_INTMODE) ? 4 : 3;
2023-08-11 22:52:11 +02:00
int cond = (!mouse_capture && !video_fullscreen) || (!mouse_scan || !mouse_state_changed()) ||
((dev->mode == MODE_STREAM) && (kbc_at_dev_queue_pos(dev, 1) >= (FIFO_SIZE - packet_size)));
2023-08-11 22:29:53 +02:00
if (!cond && (dev->mode == MODE_STREAM))
ps2_report_coordinates(dev, 1);
return cond;
}
/*
* Initialize the device for use by the user.
*
* We also get called from the various machines.
*/
void *
mouse_ps2_init(const device_t *info)
Applied all mainline PCem commits; Added experimental NVidia Riva TNT2 emulation (patch from MoochMcGee); ASUS P/I-P54TP4XE, ASUS P/I-P55T2P4, and ASUS P/I-P55TVP4 are back; National Semiconductor PC87306 Super I/O chip now correctly reenables devices after a chip power cycle; Several FDC improvements and the behavior is now a bit closer to real hardware (based on actual tests); Added MR Intel Advanced/ATX with Microid Research BIOS with support for 4 floppy drives and up to 4 IDE controllers; Added floppy drives 3 and 4, bringing the maximum to 4; You can now connect hard disks to the tertiary IDE controller; Correct undocumented behavior of the LEA instruction with register is back on 286 and later CPU's; Pentium-rea models with Intel chipsets now have port 92 (with alternate reset and alternate A20 toggle); Overhauled DMA channel read and write routines and fixed cascading; Improved IMG detection of a bad BPB (or complete lack of a BPB); Added preliminary emulation of PS/2 1.44 MB and PC-98 1.25 MB 3-mode drives (both have an inverted DENSEL pin); Removed the incorrect Amstrad mouse patch from TheCollector1995; Fixed ATAPI CD-ROM disk change detection; Windows IOCTL CD-ROM handler now tries to use direct SCSI passthrough for more things, including obtaining CD-ROM capacity; The Diamond Stealth32 (ET4000/W32p) now also works correctly on the two Award SiS 496/497 boxes; The (S)VGA handler now converts 6-bit RAMDAC RGB channels to standard 8-bit RGB using a lookup table generated at emulator start, calculated using the correct intensity conversion method and treating intensity 64 as equivalent to 63; Moved a few options from the Configuration dialog box to the menu; SIO, PIIX, and PIIX3 now have the reset control register on port CF9 as they should; Several bugfixes.
2016-12-23 03:16:24 +01:00
{
atkbc_dev_t *dev = kbc_at_dev_init(DEV_AUX);
2022-09-18 17:13:28 -04:00
int i;
dev->name = info->name;
dev->type = info->local;
dev->mode = MODE_STREAM;
2022-09-18 17:13:28 -04:00
i = device_get_config_int("buttons");
if (i > 2)
dev->flags |= FLAG_INTELLI;
if (i > 4)
dev->flags |= FLAG_EXPLORER;
2022-10-28 23:51:38 +06:00
mouse_ps2_log("%s: buttons=%d\n", dev->name, i);
/* Tell them how many buttons we have. */
2022-10-28 23:51:38 +06:00
mouse_set_buttons(i);
dev->process_cmd = ps2_write;
dev->execute_bat = ps2_bat;
dev->scan = &mouse_scan;
dev->fifo_mask = FIFO_SIZE - 1;
if (dev->port != NULL)
kbc_at_dev_reset(dev, 0);
/* Return our private data to the I/O layer. */
2023-05-11 03:02:36 -04:00
return dev;
Applied all mainline PCem commits; Added experimental NVidia Riva TNT2 emulation (patch from MoochMcGee); ASUS P/I-P54TP4XE, ASUS P/I-P55T2P4, and ASUS P/I-P55TVP4 are back; National Semiconductor PC87306 Super I/O chip now correctly reenables devices after a chip power cycle; Several FDC improvements and the behavior is now a bit closer to real hardware (based on actual tests); Added MR Intel Advanced/ATX with Microid Research BIOS with support for 4 floppy drives and up to 4 IDE controllers; Added floppy drives 3 and 4, bringing the maximum to 4; You can now connect hard disks to the tertiary IDE controller; Correct undocumented behavior of the LEA instruction with register is back on 286 and later CPU's; Pentium-rea models with Intel chipsets now have port 92 (with alternate reset and alternate A20 toggle); Overhauled DMA channel read and write routines and fixed cascading; Improved IMG detection of a bad BPB (or complete lack of a BPB); Added preliminary emulation of PS/2 1.44 MB and PC-98 1.25 MB 3-mode drives (both have an inverted DENSEL pin); Removed the incorrect Amstrad mouse patch from TheCollector1995; Fixed ATAPI CD-ROM disk change detection; Windows IOCTL CD-ROM handler now tries to use direct SCSI passthrough for more things, including obtaining CD-ROM capacity; The Diamond Stealth32 (ET4000/W32p) now also works correctly on the two Award SiS 496/497 boxes; The (S)VGA handler now converts 6-bit RAMDAC RGB channels to standard 8-bit RGB using a lookup table generated at emulator start, calculated using the correct intensity conversion method and treating intensity 64 as equivalent to 63; Moved a few options from the Configuration dialog box to the menu; SIO, PIIX, and PIIX3 now have the reset control register on port CF9 as they should; Several bugfixes.
2016-12-23 03:16:24 +01:00
}
static void
ps2_close(void *priv)
{
atkbc_dev_t *dev = (atkbc_dev_t *) priv;
free(dev);
}
Applied all mainline PCem commits; Added experimental NVidia Riva TNT2 emulation (patch from MoochMcGee); ASUS P/I-P54TP4XE, ASUS P/I-P55T2P4, and ASUS P/I-P55TVP4 are back; National Semiconductor PC87306 Super I/O chip now correctly reenables devices after a chip power cycle; Several FDC improvements and the behavior is now a bit closer to real hardware (based on actual tests); Added MR Intel Advanced/ATX with Microid Research BIOS with support for 4 floppy drives and up to 4 IDE controllers; Added floppy drives 3 and 4, bringing the maximum to 4; You can now connect hard disks to the tertiary IDE controller; Correct undocumented behavior of the LEA instruction with register is back on 286 and later CPU's; Pentium-rea models with Intel chipsets now have port 92 (with alternate reset and alternate A20 toggle); Overhauled DMA channel read and write routines and fixed cascading; Improved IMG detection of a bad BPB (or complete lack of a BPB); Added preliminary emulation of PS/2 1.44 MB and PC-98 1.25 MB 3-mode drives (both have an inverted DENSEL pin); Removed the incorrect Amstrad mouse patch from TheCollector1995; Fixed ATAPI CD-ROM disk change detection; Windows IOCTL CD-ROM handler now tries to use direct SCSI passthrough for more things, including obtaining CD-ROM capacity; The Diamond Stealth32 (ET4000/W32p) now also works correctly on the two Award SiS 496/497 boxes; The (S)VGA handler now converts 6-bit RAMDAC RGB channels to standard 8-bit RGB using a lookup table generated at emulator start, calculated using the correct intensity conversion method and treating intensity 64 as equivalent to 63; Moved a few options from the Configuration dialog box to the menu; SIO, PIIX, and PIIX3 now have the reset control register on port CF9 as they should; Several bugfixes.
2016-12-23 03:16:24 +01:00
static const device_config_t ps2_config[] = {
2022-09-18 17:13:28 -04:00
// clang-format off
{
2022-04-02 16:50:17 -04:00
.name = "buttons",
.description = "Buttons",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 2,
.file_filter = "",
.spinner = { 0 },
.selection = {
2022-10-28 23:51:38 +06:00
{ .description = "Two", .value = 2 },
{ .description = "Three", .value = 3 },
{ .description = "Wheel", .value = 4 },
{ .description = "Five + Wheel", .value = 5 },
{ .description = "" }
2022-02-26 23:31:28 -05:00
}
},
{
2022-04-02 16:50:17 -04:00
.name = "", .description = "", .type = CONFIG_END
}
2022-11-19 08:49:04 -05:00
// clang-format on
};
const device_t mouse_ps2_device = {
2022-09-18 17:13:28 -04:00
.name = "Standard PS/2 Mouse",
2022-03-13 09:28:28 -04:00
.internal_name = "ps2",
2022-09-18 17:13:28 -04:00
.flags = DEVICE_PS2,
.local = MOUSE_TYPE_PS2,
.init = mouse_ps2_init,
.close = ps2_close,
.reset = NULL,
2022-03-13 09:28:28 -04:00
{ .poll = ps2_poll },
.speed_changed = NULL,
2022-09-18 17:13:28 -04:00
.force_redraw = NULL,
.config = ps2_config
Applied all mainline PCem commits; Added experimental NVidia Riva TNT2 emulation (patch from MoochMcGee); ASUS P/I-P54TP4XE, ASUS P/I-P55T2P4, and ASUS P/I-P55TVP4 are back; National Semiconductor PC87306 Super I/O chip now correctly reenables devices after a chip power cycle; Several FDC improvements and the behavior is now a bit closer to real hardware (based on actual tests); Added MR Intel Advanced/ATX with Microid Research BIOS with support for 4 floppy drives and up to 4 IDE controllers; Added floppy drives 3 and 4, bringing the maximum to 4; You can now connect hard disks to the tertiary IDE controller; Correct undocumented behavior of the LEA instruction with register is back on 286 and later CPU's; Pentium-rea models with Intel chipsets now have port 92 (with alternate reset and alternate A20 toggle); Overhauled DMA channel read and write routines and fixed cascading; Improved IMG detection of a bad BPB (or complete lack of a BPB); Added preliminary emulation of PS/2 1.44 MB and PC-98 1.25 MB 3-mode drives (both have an inverted DENSEL pin); Removed the incorrect Amstrad mouse patch from TheCollector1995; Fixed ATAPI CD-ROM disk change detection; Windows IOCTL CD-ROM handler now tries to use direct SCSI passthrough for more things, including obtaining CD-ROM capacity; The Diamond Stealth32 (ET4000/W32p) now also works correctly on the two Award SiS 496/497 boxes; The (S)VGA handler now converts 6-bit RAMDAC RGB channels to standard 8-bit RGB using a lookup table generated at emulator start, calculated using the correct intensity conversion method and treating intensity 64 as equivalent to 63; Moved a few options from the Configuration dialog box to the menu; SIO, PIIX, and PIIX3 now have the reset control register on port CF9 as they should; Several bugfixes.
2016-12-23 03:16:24 +01:00
};