Merge branch 'master' of https://github.com/86Box/86Box.git into EngiNerd

This commit is contained in:
EngiNerd89
2021-01-14 14:49:28 +01:00
86 changed files with 4900 additions and 1479 deletions

24
src/device/CMakeLists.txt Normal file
View File

@@ -0,0 +1,24 @@
#
# 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.
#
# CMake build script.
#
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
#
# Copyright 2020,2021 David Hrdlička.
#
add_library(dev OBJECT bugger.c hwm.c hwm_lm75.c hwm_lm78.c hwm_gl518sm.c
hwm_vt82c686.c ibm_5161.c isamem.c isartc.c ../lpt.c pci_bridge.c
postcard.c serial.c vpc2007.c clock_ics9xxx.c i2c.c i2c_gpio.c
smbus_piix4.c keyboard.c keyboard_xt.c keyboard_at.c mouse.c mouse_bus.c
mouse_serial.c mouse_ps2.c phoenix_486_jumper.c)
if(LASERXT)
target_compile_definitions(dev PRIVATE USE_LASERXT)
endif()

View File

@@ -89,7 +89,8 @@
#define KBC_VEN_ACER 0x1c
#define KBC_VEN_INTEL_AMI 0x20
#define KBC_VEN_OLIVETTI 0x24
#define KBC_VEN_NCR 0x28
#define KBC_VEN_NCR 0x28
#define KBC_VEN_SAMSUNG 0x2c
#define KBC_VEN_MASK 0x3c
@@ -1058,7 +1059,7 @@ write_output(atkbd_t *dev, uint8_t val)
if ((dev->output_port ^ val) & 0x01) { /*Reset*/
if (! (val & 0x01)) {
/* Pin 0 selected. */
softresetx86(); /*Pulse reset!*/
resetx86(); /*Pulse reset!*/
cpu_set_edx();
}
}
@@ -1749,7 +1750,7 @@ kbd_write(uint16_t port, uint8_t val, void *priv)
add_data_kbd_direct(dev, 0xfa);
if (val == 0) {
kbd_log("Get scan code set: %02X\n", keyboard_mode & 3);
add_data_kbd(keyboard_mode & 3);
add_data_kbd_direct(dev, keyboard_mode & 3);
} else {
if ((val <= 3) && (val != 1)) {
keyboard_mode &= 0xfc;
@@ -1955,7 +1956,7 @@ kbd_write(uint16_t port, uint8_t val, void *priv)
case 0xaa: /* self-test */
kbd_log("ATkbc: self-test\n");
if (kbc_ven == KBC_VEN_TOSHIBA)
if ((kbc_ven == KBC_VEN_TOSHIBA) || (kbc_ven == KBC_VEN_SAMSUNG))
dev->status |= STAT_IFULL;
if (! dev->initialized) {
kbd_log("ATkbc: self-test reinitialization\n");
@@ -2298,6 +2299,7 @@ kbd_init(const device_t *info)
case KBC_VEN_AMI:
case KBC_VEN_INTEL_AMI:
case KBC_VEN_SAMSUNG:
dev->write60_ven = write60_ami;
dev->write64_ven = write64_ami;
break;
@@ -2344,6 +2346,16 @@ const device_t keyboard_at_ami_device = {
{ NULL }, NULL, NULL, NULL
};
const device_t keyboard_at_samsung_device = {
"PC/AT Keyboard (Samsung)",
0,
KBC_TYPE_ISA | KBC_VEN_SAMSUNG,
kbd_init,
kbd_close,
kbd_reset,
{ NULL }, NULL, NULL, NULL
};
const device_t keyboard_at_toshiba_device = {
"PC/AT Keyboard (Toshiba)",
0,

View File

@@ -39,7 +39,7 @@
#define AGP_BRIDGE_VIA_597 0x11068597
#define AGP_BRIDGE_VIA_598 0x11068598
#define AGP_BRIDGE_VIA_691 0x11068691
#define AGP_BRIDGE_VIA_8601 0x11068601
#define AGP_BRIDGE_VIA_8601 0x11068601
#define AGP_BRIDGE_INTEL(x) (((x) >> 16) == 0x8086)
#define AGP_BRIDGE_VIA(x) (((x) >> 16) == 0x1106)
@@ -90,10 +90,12 @@ pci_bridge_write(int func, int addr, uint8_t val, void *priv)
switch (addr) {
case 0x00: case 0x01: case 0x02: case 0x03:
case 0x06: case 0x08: case 0x09: case 0x0a:
case 0x0b: case 0x0e: case 0x1e: case 0x34:
case 0x3d: case 0x67: case 0xdc: case 0xdd:
case 0xde: case 0xdf: case 0xe0: case 0xe1:
case 0xe2: case 0xe3:
case 0x0b: case 0x0e: case 0x0f: case 0x10:
case 0x11: case 0x12: case 0x13: case 0x14:
case 0x15: case 0x16: case 0x17: case 0x1e:
case 0x34: case 0x3d: case 0x67: case 0xdc:
case 0xdd: case 0xde: case 0xdf: case 0xe0:
case 0xe1: case 0xe2: case 0xe3:
return;
case 0x04:
@@ -116,17 +118,19 @@ pci_bridge_write(int func, int addr, uint8_t val, void *priv)
dev->regs[addr] &= ~(val & 0x40);
return;
case 0x0d:
if (AGP_BRIDGE_INTEL(dev->local))
val &= 0xf8;
break;
case 0x18:
/* Parent bus number is always 0 on AGP bridges. */
case 0x0c: case 0x18:
/* Parent bus number (0x18) is always 0 on AGP bridges. */
if (AGP_BRIDGE(dev->local))
return;
break;
case 0x0d:
if (AGP_BRIDGE_VIA(dev->local))
return;
else if (AGP_BRIDGE_INTEL(dev->local))
val &= 0xf8;
break;
case 0x19:
/* Set our bus number. */
pci_bridge_log("PCI Bridge %d: remapping from bus %02X to %02X\n", dev->bus_index, dev->regs[addr], val);