2017-05-30 03:38:38 +02:00
|
|
|
/*
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
* Emulation of the Intel PIIX and PIIX3 Xcelerators.
|
|
|
|
|
*
|
2017-09-25 04:31:20 -04:00
|
|
|
* PRD format :
|
|
|
|
|
* word 0 - base address
|
2017-11-12 03:06:38 -05:00
|
|
|
* word 1 - bits 1-15 = byte count, bit 31 = end of transfer
|
2017-09-25 04:31:20 -04:00
|
|
|
*
|
2020-02-29 19:12:23 +01:00
|
|
|
* Version: @(#)intel_piix.c 1.0.23 2020/01/24
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
2017-08-24 01:14:39 -04:00
|
|
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
2017-05-30 03:38:38 +02:00
|
|
|
* Miran Grca, <mgrca8@gmail.com>
|
2017-10-17 01:59:09 -04:00
|
|
|
*
|
2020-02-29 19:12:23 +01:00
|
|
|
* Copyright 2008-2020 Sarah Walker.
|
|
|
|
|
* Copyright 2016-2020 Miran Grca.
|
2017-05-30 03:38:38 +02:00
|
|
|
*/
|
2018-04-25 23:51:13 +02:00
|
|
|
#include <stdarg.h>
|
2017-09-25 04:31:20 -04:00
|
|
|
#include <stdint.h>
|
2018-04-25 23:51:13 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
2016-06-26 00:34:39 +02:00
|
|
|
#include <string.h>
|
2017-09-25 04:31:20 -04:00
|
|
|
#include <wchar.h>
|
2018-04-25 23:51:13 +02:00
|
|
|
#define HAVE_STDARG_H
|
2017-10-17 01:59:09 -04:00
|
|
|
#include "86box.h"
|
2020-02-29 19:12:23 +01:00
|
|
|
#include "cdrom.h"
|
|
|
|
|
#include "cpu.h"
|
|
|
|
|
#include "scsi_device.h"
|
|
|
|
|
#include "scsi_cdrom.h"
|
2017-05-05 01:49:42 +02:00
|
|
|
#include "dma.h"
|
2020-02-29 19:12:23 +01:00
|
|
|
#include "86box_io.h"
|
2017-10-01 16:29:15 -04:00
|
|
|
#include "device.h"
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
#include "apm.h"
|
2017-11-05 01:57:04 -05:00
|
|
|
#include "keyboard.h"
|
2020-03-23 09:17:55 +01:00
|
|
|
#include "machine.h"
|
2016-06-26 00:34:39 +02:00
|
|
|
#include "mem.h"
|
2020-02-29 19:12:23 +01:00
|
|
|
#include "timer.h"
|
|
|
|
|
#include "nvr.h"
|
2016-06-26 00:34:39 +02:00
|
|
|
#include "pci.h"
|
2018-04-25 23:51:13 +02:00
|
|
|
#include "pic.h"
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
#include "port_92.h"
|
2020-02-29 19:12:23 +01:00
|
|
|
#include "hdc.h"
|
|
|
|
|
#include "hdc_ide.h"
|
|
|
|
|
#include "hdc_ide_sff8038i.h"
|
|
|
|
|
#include "zip.h"
|
|
|
|
|
#include "machine.h"
|
2020-03-22 22:11:55 -03:00
|
|
|
#include "smbus.h"
|
2016-06-26 00:34:39 +02:00
|
|
|
#include "piix.h"
|
|
|
|
|
|
2017-08-24 01:14:39 -04:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
#define ACPI_TIMER_FREQ 3579545
|
|
|
|
|
#define PM_FREQ ACPI_TIMER_FREQ
|
|
|
|
|
|
|
|
|
|
#define RSM_STS (1 << 15)
|
|
|
|
|
#define PWRBTN_STS (1 << 8)
|
|
|
|
|
|
|
|
|
|
#define RTC_EN (1 << 10)
|
|
|
|
|
#define PWRBTN_EN (1 << 8)
|
|
|
|
|
#define GBL_EN (1 << 5)
|
|
|
|
|
#define TMROF_EN (1 << 0)
|
|
|
|
|
|
|
|
|
|
#define SCI_EN (1 << 0)
|
|
|
|
|
#define SUS_EN (1 << 13)
|
|
|
|
|
|
|
|
|
|
#define ACPI_ENABLE 0xf1
|
|
|
|
|
#define ACPI_DISABLE 0xf0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
uint16_t io_base;
|
|
|
|
|
int base_channel;
|
|
|
|
|
} ddma_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
uint8_t gpireg[3], gporeg[4];
|
|
|
|
|
uint16_t pmsts, pmen,
|
|
|
|
|
pmcntrl;
|
|
|
|
|
uint32_t glbctl;
|
|
|
|
|
uint64_t tmr_overflow_time;
|
|
|
|
|
int timer_index;
|
|
|
|
|
} power_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
2020-03-22 22:11:55 -03:00
|
|
|
uint8_t stat, next_stat, ctl, cmd, addr,
|
2020-02-29 19:12:23 +01:00
|
|
|
data0, data1,
|
|
|
|
|
index,
|
|
|
|
|
data[32];
|
2020-03-22 22:11:55 -03:00
|
|
|
pc_timer_t command_timer;
|
|
|
|
|
} piix_smbus_t;
|
2020-02-29 19:12:23 +01:00
|
|
|
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
typedef struct
|
|
|
|
|
{
|
2020-03-24 22:43:58 +01:00
|
|
|
uint8_t cur_readout_reg, rev,
|
2020-02-29 19:12:23 +01:00
|
|
|
type, func_shift,
|
|
|
|
|
max_func, pci_slot,
|
|
|
|
|
regs[4][256],
|
|
|
|
|
readout_regs[256], board_config[2];
|
|
|
|
|
uint16_t func0_id,
|
|
|
|
|
usb_io_base, power_io_base,
|
|
|
|
|
smbus_io_base;
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
sff8038i_t *bm[2];
|
2020-02-29 19:12:23 +01:00
|
|
|
ddma_t ddma[2];
|
|
|
|
|
power_t power;
|
2020-03-22 22:11:55 -03:00
|
|
|
piix_smbus_t smbus;
|
2020-02-29 19:12:23 +01:00
|
|
|
nvr_t * nvr;
|
2018-04-25 23:51:13 +02:00
|
|
|
} piix_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_PIIX_LOG
|
|
|
|
|
int piix_do_log = ENABLE_PIIX_LOG;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2018-10-17 05:29:48 +02:00
|
|
|
piix_log(const char *fmt, ...)
|
2018-04-25 23:51:13 +02:00
|
|
|
{
|
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
|
|
if (piix_do_log) {
|
2018-10-17 05:29:48 +02:00
|
|
|
va_start(ap, fmt);
|
|
|
|
|
pclog_ex(fmt, ap);
|
2018-04-25 23:51:13 +02:00
|
|
|
va_end(ap);
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-10-17 05:29:48 +02:00
|
|
|
#else
|
|
|
|
|
#define piix_log(fmt, ...)
|
|
|
|
|
#endif
|
2017-08-24 01:14:39 -04:00
|
|
|
|
|
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
static
|
|
|
|
|
void do_irq(piix_t *dev, int func, int level)
|
|
|
|
|
{
|
|
|
|
|
if ((dev == NULL) || (func > dev->max_func) /*||
|
|
|
|
|
(dev->regs[func][0x3d] < PCI_INTA) || (dev->regs[func][0x3d] < PCI_INTD)*/)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (level) {
|
2020-03-23 02:59:50 +01:00
|
|
|
#ifdef WRONG_SPEC
|
|
|
|
|
pci_set_irq(dev->pci_slot, dev->regs[func][0x3d]);
|
|
|
|
|
#else
|
2020-02-29 19:12:23 +01:00
|
|
|
picintlevel(1 << 9);
|
2020-03-23 02:59:50 +01:00
|
|
|
#endif
|
2020-02-29 19:12:23 +01:00
|
|
|
piix_log("Raising IRQ...\n");
|
|
|
|
|
} else {
|
2020-03-23 02:59:50 +01:00
|
|
|
#ifdef WRONG_SPEC
|
|
|
|
|
pci_clear_irq(dev->pci_slot, dev->regs[func][0x3d]);
|
|
|
|
|
#else
|
2020-02-29 19:12:23 +01:00
|
|
|
picintc(1 << 9);
|
2020-03-23 02:59:50 +01:00
|
|
|
#endif
|
2020-02-29 19:12:23 +01:00
|
|
|
piix_log("Lowering IRQ...\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
piix_ide_legacy_handlers(piix_t *dev, int bus)
|
|
|
|
|
{
|
|
|
|
|
if (bus & 0x01) {
|
|
|
|
|
ide_pri_disable();
|
|
|
|
|
if ((dev->regs[1][0x04] & 0x01) && (dev->regs[1][0x41] & 0x80))
|
|
|
|
|
ide_pri_enable();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bus & 0x02) {
|
|
|
|
|
ide_sec_disable();
|
|
|
|
|
if ((dev->regs[1][0x04] & 0x01) && (dev->regs[1][0x43] & 0x80))
|
|
|
|
|
ide_sec_enable();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
static void
|
2020-02-29 19:12:23 +01:00
|
|
|
piix_ide_bm_handlers(piix_t *dev)
|
2018-04-25 23:51:13 +02:00
|
|
|
{
|
2020-02-29 19:12:23 +01:00
|
|
|
uint16_t base = (dev->regs[1][0x20] & 0xf0) | (dev->regs[1][0x21] << 8);
|
|
|
|
|
|
|
|
|
|
sff_bus_master_handler(dev->bm[0], (dev->regs[1][0x04] & 1), base);
|
|
|
|
|
sff_bus_master_handler(dev->bm[1], (dev->regs[1][0x04] & 1), base + 8);
|
|
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
static uint8_t
|
|
|
|
|
kbc_alias_reg_read(uint16_t addr, void *p)
|
|
|
|
|
{
|
|
|
|
|
uint8_t ret = inb(0x61);
|
|
|
|
|
|
|
|
|
|
return ret;
|
2018-04-25 23:51:13 +02:00
|
|
|
}
|
2016-06-26 00:34:39 +02:00
|
|
|
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
static void
|
2020-02-29 19:12:23 +01:00
|
|
|
kbc_alias_reg_write(uint16_t addr, uint8_t val, void *p)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2020-02-29 19:12:23 +01:00
|
|
|
outb(0x61, val);
|
|
|
|
|
}
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
static void
|
|
|
|
|
kbc_alias_update_io_mapping(piix_t *dev)
|
|
|
|
|
{
|
|
|
|
|
io_removehandler(0x0063, 1, kbc_alias_reg_read, NULL, NULL, kbc_alias_reg_write, NULL, NULL, dev);
|
|
|
|
|
io_removehandler(0x0065, 1, kbc_alias_reg_read, NULL, NULL, kbc_alias_reg_write, NULL, NULL, dev);
|
|
|
|
|
io_removehandler(0x0067, 1, kbc_alias_reg_read, NULL, NULL, kbc_alias_reg_write, NULL, NULL, dev);
|
|
|
|
|
|
|
|
|
|
if (dev->regs[0][0x4e] & 0x08) {
|
|
|
|
|
io_sethandler(0x0063, 1, kbc_alias_reg_read, NULL, NULL, kbc_alias_reg_write, NULL, NULL, dev);
|
|
|
|
|
io_sethandler(0x0065, 1, kbc_alias_reg_read, NULL, NULL, kbc_alias_reg_write, NULL, NULL, dev);
|
|
|
|
|
io_sethandler(0x0067, 1, kbc_alias_reg_read, NULL, NULL, kbc_alias_reg_write, NULL, NULL, dev);
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
static uint8_t
|
|
|
|
|
ddma_reg_read(uint16_t addr, void *p)
|
|
|
|
|
{
|
|
|
|
|
ddma_t *dev = (ddma_t *) p;
|
|
|
|
|
uint8_t ret = 0xff;
|
|
|
|
|
int rel_ch = (addr & 0x30) >> 4;
|
|
|
|
|
int ch = dev->base_channel + rel_ch;
|
|
|
|
|
int dmab = (ch >= 4) ? 0xc0 : 0x00;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
switch (addr & 0x0f) {
|
|
|
|
|
case 0x00:
|
|
|
|
|
ret = dma[ch].ac & 0xff;
|
|
|
|
|
break;
|
|
|
|
|
case 0x01:
|
|
|
|
|
ret = (dma[ch].ac >> 8) & 0xff;
|
|
|
|
|
break;
|
|
|
|
|
case 0x02:
|
|
|
|
|
ret = dma[ch].page;
|
|
|
|
|
break;
|
|
|
|
|
case 0x04:
|
|
|
|
|
ret = dma[ch].cc & 0xff;
|
|
|
|
|
break;
|
|
|
|
|
case 0x05:
|
|
|
|
|
ret = (dma[ch].cc >> 8) & 0xff;
|
|
|
|
|
break;
|
|
|
|
|
case 0x09:
|
|
|
|
|
ret = inb(dmab + 0x08);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
return ret;
|
|
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
static void
|
|
|
|
|
ddma_reg_write(uint16_t addr, uint8_t val, void *p)
|
|
|
|
|
{
|
|
|
|
|
ddma_t *dev = (ddma_t *) p;
|
|
|
|
|
int rel_ch = (addr & 0x30) >> 4;
|
|
|
|
|
int ch = dev->base_channel + rel_ch;
|
|
|
|
|
int page_regs[4] = { 7, 3, 1, 2 };
|
|
|
|
|
int i, dmab = (ch >= 4) ? 0xc0 : 0x00;
|
|
|
|
|
|
|
|
|
|
switch (addr & 0x0f) {
|
|
|
|
|
case 0x00:
|
|
|
|
|
dma[ch].ab = (dma[ch].ab & 0xffff00) | val;
|
|
|
|
|
dma[ch].ac = dma[ch].ab;
|
|
|
|
|
break;
|
|
|
|
|
case 0x01:
|
|
|
|
|
dma[ch].ab = (dma[ch].ab & 0xff00ff) | (val << 8);
|
|
|
|
|
dma[ch].ac = dma[ch].ab;
|
|
|
|
|
break;
|
|
|
|
|
case 0x02:
|
|
|
|
|
if (ch >= 4)
|
|
|
|
|
outb(0x88 + page_regs[rel_ch], val);
|
|
|
|
|
else
|
|
|
|
|
outb(0x80 + page_regs[rel_ch], val);
|
|
|
|
|
break;
|
|
|
|
|
case 0x04:
|
|
|
|
|
dma[ch].cb = (dma[ch].cb & 0xffff00) | val;
|
|
|
|
|
dma[ch].cc = dma[ch].cb;
|
|
|
|
|
break;
|
|
|
|
|
case 0x05:
|
|
|
|
|
dma[ch].cb = (dma[ch].cb & 0xff00ff) | (val << 8);
|
|
|
|
|
dma[ch].cc = dma[ch].cb;
|
|
|
|
|
break;
|
|
|
|
|
case 0x08:
|
|
|
|
|
outb(dmab + 0x08, val);
|
|
|
|
|
break;
|
|
|
|
|
case 0x09:
|
|
|
|
|
outb(dmab + 0x09, val);
|
|
|
|
|
break;
|
|
|
|
|
case 0x0a:
|
|
|
|
|
outb(dmab + 0x0a, val);
|
|
|
|
|
break;
|
|
|
|
|
case 0x0b:
|
|
|
|
|
outb(dmab + 0x0b, val);
|
|
|
|
|
break;
|
|
|
|
|
case 0x0d:
|
|
|
|
|
outb(dmab + 0x0d, val);
|
|
|
|
|
break;
|
|
|
|
|
case 0x0e:
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
|
outb(dmab + 0x0a, i);
|
|
|
|
|
break;
|
|
|
|
|
case 0x0f:
|
|
|
|
|
outb(dmab + 0x0a, (val << 2) | rel_ch);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
ddma_update_io_mapping(piix_t *dev, int n)
|
|
|
|
|
{
|
|
|
|
|
int base_reg = 0x92 + (n << 1);
|
|
|
|
|
|
|
|
|
|
if (dev->ddma[n].io_base != 0x0000)
|
|
|
|
|
io_removehandler(dev->usb_io_base, 0x40, ddma_reg_read, NULL, NULL, ddma_reg_write, NULL, NULL, &dev->ddma[n]);
|
|
|
|
|
|
|
|
|
|
dev->ddma[n].io_base = (dev->regs[0][base_reg] & ~0x3f) | (dev->regs[0][base_reg + 1] << 8);
|
|
|
|
|
|
|
|
|
|
if (dev->ddma[n].io_base != 0x0000)
|
|
|
|
|
io_sethandler(dev->ddma[n].io_base, 0x40, ddma_reg_read, NULL, NULL, ddma_reg_write, NULL, NULL, &dev->ddma[n]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static uint8_t
|
|
|
|
|
usb_reg_read(uint16_t addr, void *p)
|
|
|
|
|
{
|
|
|
|
|
uint8_t ret = 0xff;
|
|
|
|
|
|
|
|
|
|
switch (addr & 0x1f) {
|
|
|
|
|
case 0x10: case 0x11: case 0x12: case 0x13:
|
|
|
|
|
/* Port status */
|
|
|
|
|
ret = 0x00;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
usb_reg_write(uint16_t addr, uint8_t val, void *p)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
usb_update_io_mapping(piix_t *dev)
|
|
|
|
|
{
|
|
|
|
|
if (dev->usb_io_base != 0x0000)
|
|
|
|
|
io_removehandler(dev->usb_io_base, 0x20, usb_reg_read, NULL, NULL, usb_reg_write, NULL, NULL, dev);
|
|
|
|
|
|
|
|
|
|
dev->usb_io_base = (dev->regs[2][0x20] & ~0x1f) | (dev->regs[2][0x21] << 8);
|
|
|
|
|
|
|
|
|
|
if ((dev->regs[2][PCI_REG_COMMAND] & PCI_COMMAND_IO) && (dev->usb_io_base != 0x0000))
|
|
|
|
|
io_sethandler(dev->usb_io_base, 0x20, usb_reg_read, NULL, NULL, usb_reg_write, NULL, NULL, dev);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static uint32_t
|
|
|
|
|
power_reg_readl(uint16_t addr, void *p)
|
|
|
|
|
{
|
|
|
|
|
piix_t *dev = (piix_t *) p;
|
|
|
|
|
uint32_t timer;
|
|
|
|
|
uint32_t ret = 0xffffffff;
|
|
|
|
|
|
|
|
|
|
switch (addr & 0x3c) {
|
|
|
|
|
case 0x08:
|
|
|
|
|
/* ACPI timer */
|
|
|
|
|
timer = (tsc * ACPI_TIMER_FREQ) / machines[machine].cpu[cpu_manufacturer].cpus[cpu_effective].rspeed;
|
|
|
|
|
timer &= 0x00ffffff;
|
|
|
|
|
ret = timer;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-23 02:59:50 +01:00
|
|
|
piix_log("ACPI: Read L %08X from %04X\n", ret, addr);
|
2020-02-29 19:12:23 +01:00
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static uint16_t
|
|
|
|
|
power_reg_readw(uint16_t addr, void *p)
|
|
|
|
|
{
|
|
|
|
|
piix_t *dev = (piix_t *) p;
|
|
|
|
|
uint16_t ret = 0xffff;
|
|
|
|
|
uint32_t ret32;
|
|
|
|
|
|
|
|
|
|
switch (addr & 0x3c) {
|
|
|
|
|
case 0x00:
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ret32 = power_reg_readl(addr, p);
|
|
|
|
|
if (addr & 0x02)
|
|
|
|
|
ret = (ret32 >> 16) & 0xffff;
|
|
|
|
|
else
|
|
|
|
|
ret = ret32 & 0xffff;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-23 02:59:50 +01:00
|
|
|
piix_log("ACPI: Read W %08X from %04X\n", ret, addr);
|
2020-02-29 19:12:23 +01:00
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static uint8_t
|
|
|
|
|
power_reg_read(uint16_t addr, void *p)
|
|
|
|
|
{
|
|
|
|
|
piix_t *dev = (piix_t *) p;
|
|
|
|
|
uint32_t timer;
|
|
|
|
|
uint8_t ret = 0xff;
|
|
|
|
|
uint16_t ret16;
|
|
|
|
|
|
|
|
|
|
switch (addr & 0x3f) {
|
|
|
|
|
case 0x30: case 0x31: case 0x32:
|
|
|
|
|
ret = dev->power.gporeg[addr & 0x03];
|
2020-03-23 02:59:50 +01:00
|
|
|
piix_log("ACPI: Read B %02X from GPIREG %01X\n", ret, addr & 0x03);
|
2020-02-29 19:12:23 +01:00
|
|
|
break;
|
|
|
|
|
case 0x34: case 0x35: case 0x36: case 0x37:
|
|
|
|
|
ret = dev->power.gporeg[addr & 0x03];
|
2020-03-23 02:59:50 +01:00
|
|
|
piix_log("ACPI: Read B %02X from GPOREG %01X\n", ret, addr & 0x03);
|
2020-02-29 19:12:23 +01:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ret16 = power_reg_readw(addr, p);
|
|
|
|
|
if (addr & 0x01)
|
|
|
|
|
ret = (ret16 >> 8) & 0xff;
|
|
|
|
|
else
|
|
|
|
|
ret = ret16 & 0xff;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
power_reg_write(uint16_t addr, uint8_t val, void *p)
|
|
|
|
|
{
|
|
|
|
|
piix_t *dev = (piix_t *) p;
|
|
|
|
|
|
2020-03-23 02:59:50 +01:00
|
|
|
piix_log("ACPI: Write %02X to %04X\n", val, addr);
|
2020-02-29 19:12:23 +01:00
|
|
|
|
|
|
|
|
switch (addr & 0x3f) {
|
|
|
|
|
case 0x34: case 0x35: case 0x36: case 0x37:
|
|
|
|
|
dev->power.gporeg[addr & 0x03] = val;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
power_update_io_mapping(piix_t *dev)
|
|
|
|
|
{
|
|
|
|
|
if (dev->power_io_base != 0x0000)
|
|
|
|
|
io_removehandler(dev->power_io_base, 0x40, power_reg_read, NULL, NULL, power_reg_write, NULL, NULL, dev);
|
|
|
|
|
|
|
|
|
|
dev->power_io_base = (dev->regs[3][0x41] << 8) | (dev->regs[3][0x40] & 0xc0);
|
|
|
|
|
|
|
|
|
|
if ((dev->regs[3][0x80] & 0x01) && (dev->power_io_base != 0x0000))
|
|
|
|
|
io_sethandler(dev->power_io_base, 0x40, power_reg_read, NULL, NULL, power_reg_write, NULL, NULL, dev);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static uint8_t
|
2020-03-22 22:11:55 -03:00
|
|
|
smbus_reg_read(uint16_t addr, void *priv)
|
2020-02-29 19:12:23 +01:00
|
|
|
{
|
2020-03-22 22:11:55 -03:00
|
|
|
piix_t *dev = (piix_t *) priv;
|
2020-02-29 19:12:23 +01:00
|
|
|
uint8_t ret = 0x00;
|
|
|
|
|
|
2020-03-22 22:11:55 -03:00
|
|
|
switch (addr - dev->smbus_io_base) {
|
|
|
|
|
case 0x00:
|
|
|
|
|
ret = dev->smbus.stat;
|
|
|
|
|
break;
|
|
|
|
|
case 0x02:
|
|
|
|
|
dev->smbus.index = 0;
|
|
|
|
|
ret = dev->smbus.ctl;
|
|
|
|
|
break;
|
|
|
|
|
case 0x03:
|
|
|
|
|
ret = dev->smbus.cmd;
|
|
|
|
|
break;
|
|
|
|
|
case 0x04:
|
|
|
|
|
ret = dev->smbus.addr;
|
|
|
|
|
break;
|
|
|
|
|
case 0x05:
|
|
|
|
|
ret = dev->smbus.data0;
|
|
|
|
|
break;
|
|
|
|
|
case 0x06:
|
|
|
|
|
ret = dev->smbus.data1;
|
|
|
|
|
break;
|
|
|
|
|
case 0x07:
|
|
|
|
|
ret = dev->smbus.data[dev->smbus.index++];
|
|
|
|
|
if (dev->smbus.index > 31)
|
|
|
|
|
dev->smbus.index = 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-23 02:59:50 +01:00
|
|
|
piix_log("smbus_reg_read %02x %02x\n", addr - dev->smbus_io_base, ret);
|
2020-03-22 22:11:55 -03:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
2020-03-22 22:11:55 -03:00
|
|
|
smbus_reg_write(uint16_t addr, uint8_t val, void *priv)
|
|
|
|
|
{
|
|
|
|
|
piix_t *dev = (piix_t *) priv;
|
|
|
|
|
uint8_t smbus_addr;
|
|
|
|
|
uint8_t smbus_read;
|
|
|
|
|
uint16_t temp;
|
|
|
|
|
|
2020-03-23 02:59:50 +01:00
|
|
|
piix_log("smbus_reg_write %02x %02x\n", addr - dev->smbus_io_base, val);
|
2020-03-22 22:11:55 -03:00
|
|
|
|
|
|
|
|
dev->smbus.next_stat = 0;
|
|
|
|
|
switch (addr - dev->smbus_io_base) {
|
|
|
|
|
case 0x00:
|
|
|
|
|
/* some status bits are reset by writing 1 to them */
|
|
|
|
|
for (smbus_addr = 0x02; smbus_addr <= 0x10; smbus_addr = smbus_addr << 1) {
|
|
|
|
|
if (val & smbus_addr)
|
|
|
|
|
dev->smbus.stat = dev->smbus.stat & ~smbus_addr;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 0x02:
|
|
|
|
|
dev->smbus.ctl = val & ~(0x40); /* START always reads 0 */
|
|
|
|
|
if (val & 0x40) { /* dispatch command if START is set */
|
|
|
|
|
smbus_addr = (dev->smbus.addr >> 1);
|
|
|
|
|
if (!smbus_has_device(smbus_addr)) {
|
|
|
|
|
/* raise DEV_ERR if no device is at this address */
|
|
|
|
|
dev->smbus.next_stat = 0x4;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
smbus_read = (dev->smbus.addr & 0x01);
|
|
|
|
|
|
|
|
|
|
switch ((val >> 2) & 0x7) {
|
|
|
|
|
case 0x0: /* quick R/W */
|
|
|
|
|
dev->smbus.next_stat = 0x2;
|
|
|
|
|
break;
|
|
|
|
|
case 0x1: /* byte R/W */
|
|
|
|
|
if (smbus_read)
|
|
|
|
|
dev->smbus.data0 = smbus_read_byte(smbus_addr);
|
|
|
|
|
else
|
|
|
|
|
smbus_write_byte(smbus_addr, dev->smbus.data0);
|
|
|
|
|
dev->smbus.next_stat = 0x2;
|
|
|
|
|
break;
|
|
|
|
|
case 0x2: /* byte data R/W */
|
|
|
|
|
if (smbus_read)
|
|
|
|
|
dev->smbus.data0 = smbus_read_byte_cmd(smbus_addr, dev->smbus.cmd);
|
|
|
|
|
else
|
|
|
|
|
smbus_write_byte_cmd(smbus_addr, dev->smbus.cmd, dev->smbus.data0);
|
|
|
|
|
dev->smbus.next_stat = 0x2;
|
|
|
|
|
break;
|
|
|
|
|
case 0x3: /* word data R/W */
|
|
|
|
|
if (smbus_read) {
|
|
|
|
|
temp = smbus_read_word_cmd(smbus_addr, dev->smbus.cmd);
|
|
|
|
|
dev->smbus.data0 = (temp & 0xFF);
|
|
|
|
|
dev->smbus.data1 = (temp >> 8);
|
|
|
|
|
} else {
|
|
|
|
|
temp = (dev->smbus.data1 << 8) | dev->smbus.data0;
|
|
|
|
|
smbus_write_word_cmd(smbus_addr, dev->smbus.cmd, temp);
|
|
|
|
|
}
|
|
|
|
|
dev->smbus.next_stat = 0x2;
|
|
|
|
|
break;
|
|
|
|
|
case 0x5: /* block R/W */
|
|
|
|
|
if (smbus_read)
|
|
|
|
|
dev->smbus.data0 = smbus_read_block_cmd(smbus_addr, dev->smbus.cmd, dev->smbus.data);
|
|
|
|
|
else
|
|
|
|
|
smbus_write_block_cmd(smbus_addr, dev->smbus.cmd, dev->smbus.data, dev->smbus.data0);
|
|
|
|
|
dev->smbus.next_stat = 0x2;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 0x03:
|
|
|
|
|
dev->smbus.cmd = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0x04:
|
|
|
|
|
dev->smbus.addr = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0x05:
|
|
|
|
|
dev->smbus.data0 = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0x06:
|
|
|
|
|
dev->smbus.data1 = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0x07:
|
|
|
|
|
dev->smbus.data[dev->smbus.index++] = val;
|
|
|
|
|
if (dev->smbus.index > 31)
|
|
|
|
|
dev->smbus.index = 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (dev->smbus.next_stat) {
|
|
|
|
|
dev->smbus.stat = 0x1;
|
|
|
|
|
timer_disable(&dev->smbus.command_timer);
|
|
|
|
|
timer_set_delay_u64(&dev->smbus.command_timer, 10 * TIMER_USEC);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
smbus_inter(void *priv)
|
2020-02-29 19:12:23 +01:00
|
|
|
{
|
2020-03-22 22:11:55 -03:00
|
|
|
piix_t *dev = (piix_t *) priv;
|
|
|
|
|
dev->smbus.stat = dev->smbus.next_stat;
|
2020-02-29 19:12:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
smbus_update_io_mapping(piix_t *dev)
|
|
|
|
|
{
|
|
|
|
|
if (dev->smbus_io_base != 0x0000)
|
|
|
|
|
io_removehandler(dev->smbus_io_base, 0x10, smbus_reg_read, NULL, NULL, smbus_reg_write, NULL, NULL, dev);
|
|
|
|
|
|
|
|
|
|
dev->smbus_io_base = (dev->regs[3][0x91] << 8) | (dev->regs[3][0x90] & 0xf0);
|
|
|
|
|
|
|
|
|
|
if ((dev->regs[3][PCI_REG_COMMAND] & PCI_COMMAND_IO) && (dev->regs[3][0xd2] & 0x01) && (dev->smbus_io_base != 0x0000))
|
|
|
|
|
io_sethandler(dev->smbus_io_base, 0x10, smbus_reg_read, NULL, NULL, smbus_reg_write, NULL, NULL, dev);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
piix_write(int func, int addr, uint8_t val, void *priv)
|
|
|
|
|
{
|
|
|
|
|
piix_t *dev = (piix_t *) priv;
|
|
|
|
|
uint8_t *fregs;
|
|
|
|
|
|
|
|
|
|
/* Return on unsupported function. */
|
|
|
|
|
if (func > dev->max_func)
|
|
|
|
|
return;
|
|
|
|
|
|
2020-03-23 02:59:50 +01:00
|
|
|
piix_log("PIIX function %i write: %02X to %02X\n", func, val, addr);
|
2020-02-29 19:12:23 +01:00
|
|
|
fregs = (uint8_t *) dev->regs[func];
|
|
|
|
|
|
|
|
|
|
if (func == 0) switch (addr) {
|
|
|
|
|
case 0x04:
|
|
|
|
|
fregs[0x04] = (val & 0x08) | 0x07;
|
|
|
|
|
break;
|
|
|
|
|
case 0x05:
|
|
|
|
|
if (dev->type > 1)
|
|
|
|
|
fregs[0x05] = (val & 0x01);
|
|
|
|
|
break;
|
|
|
|
|
case 0x07:
|
|
|
|
|
if ((val & 0x40) && (dev->type > 1))
|
|
|
|
|
fregs[0x07] &= 0xbf;
|
|
|
|
|
if (val & 0x20)
|
|
|
|
|
fregs[0x07] &= 0xdf;
|
|
|
|
|
if (val & 0x10)
|
|
|
|
|
fregs[0x07] &= 0xef;
|
|
|
|
|
if (val & 0x08)
|
|
|
|
|
fregs[0x07] &= 0xf7;
|
|
|
|
|
if (val & 0x04)
|
|
|
|
|
fregs[0x07] &= 0xfb;
|
|
|
|
|
break;
|
|
|
|
|
case 0x4c:
|
|
|
|
|
fregs[0x4c] = val;
|
|
|
|
|
if (val & 0x80) {
|
|
|
|
|
if (dev->type > 1)
|
|
|
|
|
dma_alias_remove();
|
2018-04-25 23:51:13 +02:00
|
|
|
else
|
2020-02-29 19:12:23 +01:00
|
|
|
dma_alias_remove_piix();
|
|
|
|
|
} else {
|
|
|
|
|
if (dev->type > 1)
|
|
|
|
|
dma_alias_set();
|
2018-04-25 23:51:13 +02:00
|
|
|
else
|
2020-02-29 19:12:23 +01:00
|
|
|
dma_alias_set_piix();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 0x4e:
|
|
|
|
|
fregs[0x4e] = val;
|
|
|
|
|
keyboard_at_set_mouse_scan((val & 0x10) ? 1 : 0);
|
|
|
|
|
if (dev->type >= 4)
|
|
|
|
|
kbc_alias_update_io_mapping(dev);
|
|
|
|
|
break;
|
|
|
|
|
case 0x4f:
|
|
|
|
|
if (dev->type > 3)
|
|
|
|
|
fregs[0x4f] = val & 0x07;
|
|
|
|
|
else if (dev->type == 3)
|
|
|
|
|
fregs[0x4f] = val & 0x01;
|
|
|
|
|
break;
|
|
|
|
|
case 0x60: case 0x61: case 0x62: case 0x63:
|
|
|
|
|
piix_log("Set IRQ routing: INT %c -> %02X\n", 0x41 + (addr & 0x03), val);
|
|
|
|
|
fregs[addr] = val & 0x8f;
|
|
|
|
|
if (val & 0x80)
|
|
|
|
|
pci_set_irq_routing(PCI_INTA + (addr & 0x03), PCI_IRQ_DISABLED);
|
|
|
|
|
else
|
|
|
|
|
pci_set_irq_routing(PCI_INTA + (addr & 0x03), val & 0xf);
|
|
|
|
|
break;
|
|
|
|
|
case 0x64:
|
|
|
|
|
if (dev->type > 3)
|
|
|
|
|
fregs[0x64] = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0x69:
|
|
|
|
|
if (dev->type > 1)
|
|
|
|
|
fregs[0x69] = val & 0xfe;
|
|
|
|
|
else
|
|
|
|
|
fregs[0x69] = val & 0xfa;
|
|
|
|
|
break;
|
|
|
|
|
case 0x6a:
|
|
|
|
|
switch (dev->type) {
|
2020-03-24 22:43:58 +01:00
|
|
|
case 1:
|
2020-02-29 19:12:23 +01:00
|
|
|
default:
|
|
|
|
|
fregs[0x6a] = (fregs[0x6a] & 0xfb) | (val & 0x04);
|
2020-03-24 22:43:58 +01:00
|
|
|
fregs[0x0e] = (val & 0x04) ? 0x80 : 0x00;
|
|
|
|
|
piix_log("PIIX: Write %02X\n", val);
|
|
|
|
|
dev->max_func = 0 + !!(val & 0x04);
|
2020-02-29 19:12:23 +01:00
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
fregs[0x6a] = val & 0xd1;
|
2020-03-24 22:43:58 +01:00
|
|
|
piix_log("PIIX3: Write %02X\n", val);
|
2020-02-29 19:12:23 +01:00
|
|
|
dev->max_func = 1 + !!(val & 0x10);
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
fregs[0x6a] = val & 0x80;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 0x6b:
|
|
|
|
|
if ((dev->type > 1) && (val & 0x80))
|
|
|
|
|
fregs[0x6b] &= 0x7f;
|
|
|
|
|
return;
|
|
|
|
|
case 0x70: case 0x71:
|
|
|
|
|
if ((dev->type > 1) && (addr == 0x71))
|
2018-04-25 23:51:13 +02:00
|
|
|
break;
|
2020-02-29 19:12:23 +01:00
|
|
|
if (dev->type < 4) {
|
|
|
|
|
piix_log("Set MIRQ routing: MIRQ%i -> %02X\n", addr & 0x01, val);
|
|
|
|
|
if (dev->type > 1)
|
|
|
|
|
fregs[addr] = val & 0xef;
|
2018-05-21 19:04:05 +02:00
|
|
|
else
|
2020-02-29 19:12:23 +01:00
|
|
|
fregs[addr] = val & 0xcf;
|
2018-04-25 23:51:13 +02:00
|
|
|
if (val & 0x80)
|
|
|
|
|
pci_set_mirq_routing(PCI_MIRQ0, PCI_IRQ_DISABLED);
|
|
|
|
|
else
|
|
|
|
|
pci_set_mirq_routing(PCI_MIRQ0, val & 0xf);
|
2020-02-29 19:12:23 +01:00
|
|
|
piix_log("MIRQ%i is %s\n", addr & 0x01, (val & 0x20) ? "disabled" : "enabled");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 0x76: case 0x77:
|
|
|
|
|
if (dev->type > 1)
|
|
|
|
|
fregs[addr] = val & 0x87;
|
|
|
|
|
else
|
|
|
|
|
fregs[addr] = val & 0x8f;
|
|
|
|
|
break;
|
|
|
|
|
case 0x78: case 0x79:
|
|
|
|
|
if (dev->type < 4)
|
|
|
|
|
fregs[addr] = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0x80:
|
|
|
|
|
if (dev->type > 1)
|
|
|
|
|
fregs[addr] = val & 0x7f;
|
|
|
|
|
break;
|
|
|
|
|
case 0x81:
|
|
|
|
|
if (dev->type > 1)
|
|
|
|
|
fregs[addr] = val & 0x0f;
|
|
|
|
|
break;
|
|
|
|
|
case 0x90:
|
|
|
|
|
if (dev->type > 3)
|
|
|
|
|
fregs[addr] = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0x91:
|
|
|
|
|
if (dev->type > 3)
|
|
|
|
|
fregs[addr] = val & 0xfc;
|
|
|
|
|
break;
|
|
|
|
|
case 0x92: case 0x93: case 0x94: case 0x95:
|
|
|
|
|
if (dev->type == 4) {
|
|
|
|
|
if (addr & 0x01)
|
|
|
|
|
fregs[addr] = val & 0xc0;
|
|
|
|
|
else
|
|
|
|
|
fregs[addr] = val & 0xff;
|
|
|
|
|
ddma_update_io_mapping(dev, (addr >> 2) & 1);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 0xa0:
|
|
|
|
|
if (dev->type < 4)
|
|
|
|
|
fregs[addr] = val & 0x1f;
|
|
|
|
|
break;
|
|
|
|
|
case 0xa2: case 0xa5: case 0xa6: case 0xa8:
|
|
|
|
|
case 0xaa: case 0xac: case 0xae:
|
|
|
|
|
if (dev->type < 4)
|
|
|
|
|
fregs[addr] = val & 0xff;
|
|
|
|
|
break;
|
|
|
|
|
case 0xa3: case 0xab:
|
|
|
|
|
if (dev->type == 3)
|
|
|
|
|
fregs[addr] = val & 0x01;
|
|
|
|
|
break;
|
|
|
|
|
case 0xa4:
|
|
|
|
|
if (dev->type < 4)
|
|
|
|
|
fregs[addr] = val & 0xfb;
|
|
|
|
|
break;
|
|
|
|
|
case 0xa7:
|
|
|
|
|
if (dev->type == 3)
|
|
|
|
|
fregs[addr] = val & 0xef;
|
|
|
|
|
else if (dev->type < 3)
|
|
|
|
|
fregs[addr] = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0xb0:
|
|
|
|
|
if (dev->type > 3)
|
|
|
|
|
fregs[addr] = (fregs[addr] & 0x8c) | (val & 0x73);
|
|
|
|
|
break;
|
|
|
|
|
case 0xb1:
|
|
|
|
|
if (dev->type > 3)
|
|
|
|
|
fregs[addr] = val & 0xdf;
|
|
|
|
|
break;
|
|
|
|
|
case 0xb2:
|
|
|
|
|
if (dev->type > 3)
|
|
|
|
|
fregs[addr] = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0xb3:
|
|
|
|
|
if (dev->type > 3)
|
|
|
|
|
fregs[addr] = val & 0xfb;
|
|
|
|
|
break;
|
|
|
|
|
case 0xcb:
|
|
|
|
|
if (dev->type == 4) {
|
|
|
|
|
fregs[addr] = val & 0x3d;
|
|
|
|
|
|
|
|
|
|
nvr_at_handler(0, 0x0070, dev->nvr);
|
|
|
|
|
nvr_at_handler(0, 0x0072, dev->nvr);
|
|
|
|
|
|
|
|
|
|
if ((val & 0x01) && (dev->regs[2][0xff] & 0x10))
|
|
|
|
|
nvr_at_handler(1, 0x0070, dev->nvr);
|
|
|
|
|
if (val & 0x04)
|
|
|
|
|
nvr_at_handler(1, 0x0072, dev->nvr);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
nvr_wp_set(!!(val & 0x08), 0, dev->nvr);
|
|
|
|
|
nvr_wp_set(!!(val & 0x10), 1, dev->nvr);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
} else if (func == 1) switch(addr) { /* IDE */
|
|
|
|
|
case 0x04:
|
|
|
|
|
fregs[0x04] = (val & 5);
|
|
|
|
|
if (dev->type < 3)
|
|
|
|
|
fregs[0x04] |= 0x02;
|
|
|
|
|
piix_ide_legacy_handlers(dev, 0x03);
|
|
|
|
|
piix_ide_bm_handlers(dev);
|
|
|
|
|
break;
|
|
|
|
|
case 0x07:
|
|
|
|
|
if (val & 0x20)
|
|
|
|
|
fregs[0x07] &= 0xdf;
|
|
|
|
|
if (val & 0x10)
|
|
|
|
|
fregs[0x07] &= 0xef;
|
|
|
|
|
if (val & 0x08)
|
|
|
|
|
fregs[0x07] &= 0xf7;
|
|
|
|
|
break;
|
|
|
|
|
case 0x0d:
|
|
|
|
|
fregs[0x0d] = val & 0xf0;
|
|
|
|
|
break;
|
|
|
|
|
case 0x20:
|
|
|
|
|
fregs[0x20] = (val & 0xf0) | 1;
|
|
|
|
|
piix_ide_bm_handlers(dev);
|
|
|
|
|
break;
|
|
|
|
|
case 0x21:
|
|
|
|
|
fregs[0x21] = val;
|
|
|
|
|
piix_ide_bm_handlers(dev);
|
|
|
|
|
break;
|
2020-03-23 02:59:50 +01:00
|
|
|
case 0x3c:
|
|
|
|
|
piix_log("IDE IRQ write: %02X\n", val);
|
|
|
|
|
fregs[0x3c] = val;
|
|
|
|
|
break;
|
2020-02-29 19:12:23 +01:00
|
|
|
case 0x40: case 0x42:
|
|
|
|
|
fregs[addr] = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0x41: case 0x43:
|
|
|
|
|
fregs[addr] = val & ((dev->type > 1) ? 0xf3 : 0xb3);
|
|
|
|
|
piix_ide_legacy_handlers(dev, 1 << !!(addr & 0x02));
|
|
|
|
|
break;
|
|
|
|
|
case 0x44:
|
|
|
|
|
if (dev->type > 1)
|
|
|
|
|
fregs[0x44] = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0x48:
|
|
|
|
|
if (dev->type > 3)
|
|
|
|
|
fregs[0x48] = val & 0x0f;
|
|
|
|
|
break;
|
|
|
|
|
case 0x4a: case 0x4b:
|
|
|
|
|
if (dev->type > 4)
|
|
|
|
|
fregs[addr] = val & 0x33;
|
|
|
|
|
break;
|
|
|
|
|
} else if (func == 2) switch(addr) { /* USB */
|
|
|
|
|
case 0x04:
|
|
|
|
|
fregs[0x04] = (val & 5);
|
|
|
|
|
usb_update_io_mapping(dev);
|
|
|
|
|
break;
|
|
|
|
|
case 0x07:
|
|
|
|
|
if (val & 0x20)
|
|
|
|
|
fregs[0x07] &= 0xdf;
|
|
|
|
|
if (val & 0x10)
|
|
|
|
|
fregs[0x07] &= 0xef;
|
|
|
|
|
if (val & 0x08)
|
|
|
|
|
fregs[0x07] &= 0xf7;
|
|
|
|
|
break;
|
|
|
|
|
case 0x0d:
|
|
|
|
|
fregs[0x0d] = val & 0xf0;
|
|
|
|
|
break;
|
|
|
|
|
case 0x20:
|
|
|
|
|
fregs[0x20] = (val & 0xe0) | 1;
|
|
|
|
|
usb_update_io_mapping(dev);
|
|
|
|
|
break;
|
|
|
|
|
case 0x21:
|
|
|
|
|
fregs[0x21] = val;
|
|
|
|
|
usb_update_io_mapping(dev);
|
|
|
|
|
break;
|
|
|
|
|
case 0x3c:
|
|
|
|
|
fregs[0x3c] = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0x6a:
|
|
|
|
|
if (dev->type < 4)
|
|
|
|
|
fregs[0x6a] = val & 0x01;
|
|
|
|
|
break;
|
|
|
|
|
case 0xc0:
|
|
|
|
|
fregs[0xc0] = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0xc1:
|
|
|
|
|
fregs[0xc1] = val & 0xbf;
|
|
|
|
|
break;
|
|
|
|
|
case 0xff:
|
|
|
|
|
if (dev->type >= 4) {
|
|
|
|
|
fregs[addr] = val & 0x10;
|
|
|
|
|
nvr_at_handler(0, 0x0070, dev->nvr);
|
|
|
|
|
if ((dev->regs[0][0xcb] & 0x01) && (dev->regs[2][0xff] & 0x10))
|
|
|
|
|
nvr_at_handler(1, 0x0070, dev->nvr);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
} else if (func == 3) switch(addr) { /* Power Management */
|
|
|
|
|
case 0x04:
|
|
|
|
|
fregs[0x04] = (val & 1);
|
|
|
|
|
power_update_io_mapping(dev);
|
|
|
|
|
smbus_update_io_mapping(dev);
|
|
|
|
|
break;
|
|
|
|
|
case 0x07:
|
|
|
|
|
if (val & 0x08)
|
|
|
|
|
fregs[0x07] &= 0xf7;
|
|
|
|
|
break;
|
|
|
|
|
#if 0
|
|
|
|
|
case 0x3c:
|
|
|
|
|
fregs[0x3c] = val;
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
case 0x40:
|
|
|
|
|
fregs[0x40] = (val & 0xc0) | 1;
|
|
|
|
|
power_update_io_mapping(dev);
|
|
|
|
|
break;
|
|
|
|
|
case 0x41:
|
|
|
|
|
fregs[0x41] = val;
|
|
|
|
|
power_update_io_mapping(dev);
|
|
|
|
|
break;
|
|
|
|
|
case 0x44: case 0x45: case 0x46: case 0x47:
|
|
|
|
|
case 0x48: case 0x49:
|
|
|
|
|
case 0x4c: case 0x4d: case 0x4e:
|
|
|
|
|
case 0x54: case 0x55: case 0x56: case 0x57:
|
|
|
|
|
case 0x59: case 0x5a:
|
|
|
|
|
case 0x5c: case 0x5d: case 0x5e: case 0x5f:
|
|
|
|
|
case 0x60: case 0x61: case 0x62:
|
|
|
|
|
case 0x64: case 0x65:
|
|
|
|
|
case 0x67: case 0x68: case 0x69:
|
|
|
|
|
case 0x6c: case 0x6e: case 0x6f:
|
|
|
|
|
case 0x70: case 0x71:
|
|
|
|
|
case 0x74: case 0x77: case 0x78: case 0x79:
|
|
|
|
|
case 0x7c: case 0x7d:
|
|
|
|
|
case 0xd3: case 0xd4:
|
|
|
|
|
case 0xd5:
|
|
|
|
|
fregs[addr] = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0x4a:
|
|
|
|
|
fregs[addr] = val & 0x73;
|
|
|
|
|
break;
|
|
|
|
|
case 0x4b:
|
|
|
|
|
fregs[addr] = val & 0x01;
|
|
|
|
|
break;
|
|
|
|
|
case 0x4f: case 0x80: case 0xd2:
|
|
|
|
|
fregs[addr] = val & 0x0f;
|
|
|
|
|
if (addr == 0x80)
|
|
|
|
|
power_update_io_mapping(dev);
|
|
|
|
|
else if (addr == 0xd2)
|
|
|
|
|
smbus_update_io_mapping(dev);
|
|
|
|
|
break;
|
|
|
|
|
case 0x50:
|
|
|
|
|
fregs[addr] = val & 0x3f;
|
|
|
|
|
break;
|
|
|
|
|
case 0x51:
|
|
|
|
|
fregs[addr] = val & 0x58;
|
|
|
|
|
break;
|
|
|
|
|
case 0x52:
|
|
|
|
|
fregs[addr] = val & 0x7f;
|
|
|
|
|
break;
|
|
|
|
|
case 0x58:
|
|
|
|
|
fregs[addr] = val & 0x77;
|
|
|
|
|
break;
|
|
|
|
|
case 0x5b:
|
|
|
|
|
fregs[addr] = val & 0x03;
|
|
|
|
|
break;
|
|
|
|
|
case 0x63:
|
|
|
|
|
fregs[addr] = val & 0xf7;
|
|
|
|
|
break;
|
|
|
|
|
case 0x66:
|
|
|
|
|
fregs[addr] = val & 0xef;
|
|
|
|
|
break;
|
|
|
|
|
case 0x6a: case 0x72: case 0x7a: case 0x7e:
|
|
|
|
|
fregs[addr] = val & 0x1f;
|
|
|
|
|
break;
|
|
|
|
|
case 0x6d: case 0x75:
|
|
|
|
|
fregs[addr] = val & 0x80;
|
|
|
|
|
break;
|
|
|
|
|
case 0x90:
|
|
|
|
|
fregs[0x90] = (val & 0xf0) | 1;
|
|
|
|
|
smbus_update_io_mapping(dev);
|
|
|
|
|
break;
|
|
|
|
|
case 0x91:
|
|
|
|
|
fregs[0x91] = val;
|
|
|
|
|
smbus_update_io_mapping(dev);
|
|
|
|
|
break;
|
2018-04-25 23:51:13 +02:00
|
|
|
}
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
static uint8_t
|
|
|
|
|
piix_read(int func, int addr, void *priv)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
2018-04-25 23:51:13 +02:00
|
|
|
piix_t *dev = (piix_t *) priv;
|
2020-02-29 19:12:23 +01:00
|
|
|
uint8_t ret = 0xff, *fregs;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
/* Return on unsupported function. */
|
|
|
|
|
if (func <= dev->max_func) {
|
|
|
|
|
fregs = (uint8_t *) dev->regs[func];
|
|
|
|
|
ret = fregs[addr];
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2020-03-23 02:59:50 +01:00
|
|
|
piix_log("PIIX function %i read: %02X from %02X\n", func, ret, addr);
|
2018-04-25 23:51:13 +02:00
|
|
|
}
|
|
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
return ret;
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
static void
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
board_write(uint16_t port, uint8_t val, void *priv)
|
2016-06-26 00:34:39 +02:00
|
|
|
{
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
piix_t *dev = (piix_t *) priv;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
if (port == 0x0078)
|
|
|
|
|
dev->board_config[0] = val;
|
|
|
|
|
else if (port == 0x0079)
|
|
|
|
|
dev->board_config[1] = val;
|
|
|
|
|
else if (port == 0x00e0)
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
dev->cur_readout_reg = val;
|
|
|
|
|
else if (port == 0x00e1)
|
|
|
|
|
dev->readout_regs[dev->cur_readout_reg] = val;
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
static uint8_t
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
board_read(uint16_t port, void *priv)
|
2017-02-09 01:41:32 +01:00
|
|
|
{
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
piix_t *dev = (piix_t *) priv;
|
2020-02-29 19:12:23 +01:00
|
|
|
uint8_t ret = 0x64;
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
if (port == 0x0078)
|
|
|
|
|
ret = dev->board_config[0];
|
|
|
|
|
else if (port == 0x0079)
|
|
|
|
|
ret = dev->board_config[1];
|
|
|
|
|
else if (port == 0x00e0)
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
ret = dev->cur_readout_reg;
|
|
|
|
|
else if (port == 0x00e1)
|
|
|
|
|
ret = dev->readout_regs[dev->cur_readout_reg];
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
return ret;
|
2017-02-09 01:41:32 +01:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
static void
|
2020-02-29 19:12:23 +01:00
|
|
|
piix_reset_hard(piix_t *dev)
|
2018-04-25 23:51:13 +02:00
|
|
|
{
|
2020-02-29 19:12:23 +01:00
|
|
|
int i;
|
|
|
|
|
uint8_t *fregs;
|
|
|
|
|
|
|
|
|
|
uint16_t old_base = (dev->regs[1][0x20] & 0xf0) | (dev->regs[1][0x21] << 8);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2020-03-24 22:43:58 +01:00
|
|
|
sff_bus_master_reset(dev->bm[0], old_base);
|
|
|
|
|
sff_bus_master_reset(dev->bm[1], old_base + 8);
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
|
2020-03-24 22:43:58 +01:00
|
|
|
if (dev->type == 4) {
|
|
|
|
|
sff_set_irq_mode(dev->bm[0], 0);
|
|
|
|
|
sff_set_irq_mode(dev->bm[1], 0);
|
|
|
|
|
}
|
2020-02-29 19:12:23 +01:00
|
|
|
|
2020-03-23 02:59:50 +01:00
|
|
|
#ifdef ENABLE_PIIX_LOG
|
2020-03-24 22:43:58 +01:00
|
|
|
piix_log("piix_reset_hard()\n");
|
2020-03-23 02:59:50 +01:00
|
|
|
#endif
|
2020-03-24 22:43:58 +01:00
|
|
|
ide_pri_disable();
|
|
|
|
|
ide_sec_disable();
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
if (dev->type > 3) {
|
|
|
|
|
nvr_at_handler(0, 0x0072, dev->nvr);
|
|
|
|
|
nvr_wp_set(0, 0, dev->nvr);
|
|
|
|
|
nvr_wp_set(0, 1, dev->nvr);
|
2020-03-22 01:17:49 +01:00
|
|
|
nvr_at_handler(1, 0x0074, dev->nvr);
|
|
|
|
|
nvr_at_handler(1, 0x0076, dev->nvr);
|
|
|
|
|
}
|
2020-02-29 19:12:23 +01:00
|
|
|
|
|
|
|
|
/* Clear all 4 functions' arrays and set their vendor and device ID's. */
|
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
|
memset(dev->regs[i], 0, 256);
|
|
|
|
|
dev->regs[i][0x00] = 0x86; dev->regs[i][0x01] = 0x80; /* Intel */
|
|
|
|
|
dev->regs[i][0x02] = (dev->func0_id & 0xff) + (i << dev->func_shift);
|
|
|
|
|
dev->regs[i][0x03] = (dev->func0_id >> 8);
|
|
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
/* Function 0: PCI to ISA Bridge */
|
|
|
|
|
fregs = (uint8_t *) dev->regs[0];
|
2020-03-23 02:59:50 +01:00
|
|
|
piix_log("PIIX Function 0: 8086:%02X%02X\n", fregs[0x03], fregs[0x02]);
|
2020-03-24 22:43:58 +01:00
|
|
|
fregs[0x04] = 0x07;
|
2020-02-29 19:12:23 +01:00
|
|
|
fregs[0x06] = 0x80; fregs[0x07] = 0x02;
|
2020-03-24 22:43:58 +01:00
|
|
|
if (dev->type == 4)
|
|
|
|
|
fregs[0x08] = (dev->rev & 0x08) ? 0x02 : (dev->rev & 0x07);
|
|
|
|
|
else
|
|
|
|
|
fregs[0x08] = dev->rev;
|
2020-02-29 19:12:23 +01:00
|
|
|
fregs[0x09] = 0x00;
|
|
|
|
|
fregs[0x0a] = 0x01; fregs[0x0b] = 0x06;
|
2020-03-24 22:43:58 +01:00
|
|
|
fregs[0x0e] = (dev->type > 1) ? 0x80 : 0x00;
|
2020-02-29 19:12:23 +01:00
|
|
|
fregs[0x4c] = 0x4d;
|
|
|
|
|
fregs[0x4e] = 0x03;
|
|
|
|
|
fregs[0x60] = fregs[0x61] = fregs[0x62] = fregs[0x63] = 0x80;
|
|
|
|
|
fregs[0x64] = (dev->type > 3) ? 0x10 : 0x00;
|
|
|
|
|
fregs[0x69] = 0x02;
|
|
|
|
|
fregs[0x70] = (dev->type < 4) ? 0x80 : 0x00;
|
|
|
|
|
fregs[0x71] = (dev->type < 3) ? 0x80 : 0x00;
|
|
|
|
|
fregs[0x76] = fregs[0x77] = (dev->type > 1) ? 0x04 : 0x0c;
|
|
|
|
|
fregs[0x78] = (dev->type < 4) ? 0x02 : 0x00;
|
|
|
|
|
fregs[0xa0] = (dev->type < 4) ? 0x08 : 0x00;
|
|
|
|
|
fregs[0xa8] = (dev->type < 4) ? 0x0f : 0x00;
|
|
|
|
|
if (dev->type == 4)
|
|
|
|
|
fregs[0xb0] = (is_pentium) ? 0x00 : 0x04;
|
|
|
|
|
fregs[0xcb] = (dev->type > 3) ? 0x21 : 0x00;
|
|
|
|
|
dev->max_func = 0;
|
|
|
|
|
|
|
|
|
|
/* Function 1: IDE */
|
2020-03-24 22:43:58 +01:00
|
|
|
fregs = (uint8_t *) dev->regs[1];
|
|
|
|
|
piix_log("PIIX Function 1: 8086:%02X%02X\n", fregs[0x03], fregs[0x02]);
|
|
|
|
|
fregs[0x04] = (dev->type > 3) ? 0x05 : 0x07;
|
|
|
|
|
fregs[0x06] = 0x80; fregs[0x07] = 0x02;
|
|
|
|
|
if (dev->type == 4)
|
|
|
|
|
fregs[0x08] = dev->rev & 0x07;
|
|
|
|
|
else
|
|
|
|
|
fregs[0x08] = dev->rev;
|
|
|
|
|
fregs[0x09] = 0x80;
|
|
|
|
|
fregs[0x0a] = 0x01; fregs[0x0b] = 0x01;
|
|
|
|
|
fregs[0x20] = 0x01;
|
|
|
|
|
dev->max_func = 0; /* It starts with IDE disabled, then enables it. */
|
2020-02-29 19:12:23 +01:00
|
|
|
|
|
|
|
|
/* Function 2: USB */
|
2020-03-24 22:43:58 +01:00
|
|
|
if (dev->type > 1) {
|
2020-02-29 19:12:23 +01:00
|
|
|
fregs = (uint8_t *) dev->regs[2];
|
2020-03-23 02:59:50 +01:00
|
|
|
piix_log("PIIX Function 2: 8086:%02X%02X\n", fregs[0x03], fregs[0x02]);
|
2020-02-29 19:12:23 +01:00
|
|
|
fregs[0x04] = 0x05;
|
|
|
|
|
fregs[0x06] = 0x80; fregs[0x07] = 0x02;
|
2020-03-24 22:43:58 +01:00
|
|
|
if (dev->type == 4)
|
|
|
|
|
fregs[0x08] = dev->rev & 0x07;
|
|
|
|
|
else
|
|
|
|
|
fregs[0x08] = dev->rev;
|
2020-02-29 19:12:23 +01:00
|
|
|
fregs[0x0a] = 0x03; fregs[0x0b] = 0x0c;
|
|
|
|
|
fregs[0x20] = 0x01;
|
|
|
|
|
fregs[0x3d] = 0x04;
|
|
|
|
|
fregs[0x60] = (dev->type > 3) ? 0x10: 0x00;
|
|
|
|
|
fregs[0x6a] = (dev->type == 3) ? 0x01 : 0x00;
|
|
|
|
|
fregs[0xc1] = 0x20;
|
|
|
|
|
fregs[0xff] = (dev->type > 3) ? 0x10 : 0x00;
|
2020-03-24 22:43:58 +01:00
|
|
|
dev->max_func = 1; /* It starts with USB disabled, then enables it. */
|
2018-04-25 23:51:13 +02:00
|
|
|
}
|
2020-02-29 19:12:23 +01:00
|
|
|
|
|
|
|
|
/* Function 3: Power Management */
|
|
|
|
|
if (dev->type > 3) {
|
|
|
|
|
fregs = (uint8_t *) dev->regs[3];
|
2020-03-23 02:59:50 +01:00
|
|
|
piix_log("PIIX Function 3: 8086:%02X%02X\n", fregs[0x03], fregs[0x02]);
|
2020-02-29 19:12:23 +01:00
|
|
|
fregs[0x06] = 0x80; fregs[0x07] = 0x02;
|
2020-03-24 22:43:58 +01:00
|
|
|
fregs[0x08] = (dev->rev & 0x08) ? 0x02 : (dev->rev & 0x07);
|
2020-02-29 19:12:23 +01:00
|
|
|
fregs[0x0a] = 0x80; fregs[0x0b] = 0x06;
|
|
|
|
|
/* NOTE: The Specification Update says this should default to 0x00 and be read-only. */
|
2020-03-23 02:59:50 +01:00
|
|
|
#ifdef WRONG_SPEC
|
|
|
|
|
fregs[0x3d] = 0x01;
|
|
|
|
|
#endif
|
2020-02-29 19:12:23 +01:00
|
|
|
fregs[0x40] = 0x01;
|
|
|
|
|
fregs[0x90] = 0x01;
|
|
|
|
|
dev->max_func = 3;
|
2018-04-25 23:51:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pci_set_irq_routing(PCI_INTA, PCI_IRQ_DISABLED);
|
|
|
|
|
pci_set_irq_routing(PCI_INTB, PCI_IRQ_DISABLED);
|
|
|
|
|
pci_set_irq_routing(PCI_INTC, PCI_IRQ_DISABLED);
|
|
|
|
|
pci_set_irq_routing(PCI_INTD, PCI_IRQ_DISABLED);
|
|
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
if (dev->type < 4)
|
|
|
|
|
pci_set_mirq_routing(PCI_MIRQ0, PCI_IRQ_DISABLED);
|
|
|
|
|
if (dev->type < 3)
|
2018-04-25 23:51:13 +02:00
|
|
|
pci_set_mirq_routing(PCI_MIRQ1, PCI_IRQ_DISABLED);
|
2020-02-29 19:12:23 +01:00
|
|
|
|
|
|
|
|
if (dev->type == 4) {
|
|
|
|
|
dev->power.gporeg[0] = 0xff;
|
|
|
|
|
dev->power.gporeg[1] = 0xbf;
|
|
|
|
|
dev->power.gporeg[2] = 0xff;
|
|
|
|
|
dev->power.gporeg[3] = 0x7f;
|
|
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
}
|
2016-12-23 03:16:24 +01:00
|
|
|
|
2017-01-31 20:39:36 +01:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
static void
|
|
|
|
|
piix_close(void *p)
|
|
|
|
|
{
|
|
|
|
|
piix_t *piix = (piix_t *)p;
|
2017-09-04 05:15:12 +02:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
free(piix);
|
2017-08-28 23:47:09 +02:00
|
|
|
}
|
|
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
*piix_init(const device_t *info)
|
2017-08-28 23:47:09 +02:00
|
|
|
{
|
2020-03-23 02:59:50 +01:00
|
|
|
int i;
|
2020-03-23 09:17:55 +01:00
|
|
|
CPU *cpu_s = &machines[machine].cpu[cpu_manufacturer].cpus[cpu];
|
2020-03-23 02:59:50 +01:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
piix_t *dev = (piix_t *) malloc(sizeof(piix_t));
|
|
|
|
|
memset(dev, 0, sizeof(piix_t));
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2020-03-24 22:43:58 +01:00
|
|
|
dev->type = info->local & 0x0f;
|
|
|
|
|
/* If (dev->type == 4) and (dev->rev & 0x08), then this is PIIX4E. */
|
|
|
|
|
dev->rev = (info->local >> 4) & 0x0f;
|
2020-02-29 19:12:23 +01:00
|
|
|
dev->func_shift = info->local >> 8;
|
|
|
|
|
dev->func0_id = info->local >> 16;
|
2016-12-23 03:16:24 +01:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
dev->pci_slot = pci_add_card(PCI_ADD_SOUTHBRIDGE, piix_read, piix_write, dev);
|
2020-03-23 02:59:50 +01:00
|
|
|
piix_log("PIIX%i: Added to slot: %02X\n", dev->type, dev->pci_slot);
|
2016-12-23 03:16:24 +01:00
|
|
|
|
2020-03-24 22:43:58 +01:00
|
|
|
dev->bm[0] = device_add_inst(&sff8038i_device, 1);
|
|
|
|
|
dev->bm[1] = device_add_inst(&sff8038i_device, 2);
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
|
2020-03-22 01:17:49 +01:00
|
|
|
if (dev->type > 3)
|
2020-02-29 19:12:23 +01:00
|
|
|
dev->nvr = device_add(&piix4_nvr_device);
|
|
|
|
|
|
|
|
|
|
piix_reset_hard(dev);
|
2016-12-23 03:16:24 +01:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
device_add(&apm_device);
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
device_add(&port_92_pci_device);
|
2017-01-31 20:39:36 +01:00
|
|
|
|
2018-04-25 23:51:13 +02:00
|
|
|
dma_alias_set();
|
2017-09-04 05:15:12 +02:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
if (dev->type < 4)
|
|
|
|
|
pci_enable_mirq(0);
|
|
|
|
|
if (dev->type < 3)
|
|
|
|
|
pci_enable_mirq(1);
|
2018-04-25 23:51:13 +02:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
dev->readout_regs[1] = 0x40;
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
|
|
|
|
|
/* Port E1 register 01 (TODO: Find how multipliers > 3.0 are defined):
|
|
|
|
|
|
|
|
|
|
Bit 6: 1 = can boot, 0 = no;
|
|
|
|
|
Bit 7, 1 = multiplier (00 = 2.5, 01 = 2.0, 10 = 3.0, 11 = 1.5);
|
|
|
|
|
Bit 5, 4 = bus speed (00 = 50 MHz, 01 = 66 MHz, 10 = 60 MHz, 11 = ????):
|
|
|
|
|
Bit 7, 5, 4, 1: 0000 = 125 MHz, 0010 = 166 MHz, 0100 = 150 MHz, 0110 = ??? MHz;
|
|
|
|
|
0001 = 100 MHz, 0011 = 133 MHz, 0101 = 120 MHz, 0111 = ??? MHz;
|
|
|
|
|
1000 = 150 MHz, 1010 = 200 MHz, 1100 = 180 MHz, 1110 = ??? MHz;
|
|
|
|
|
1001 = 75 MHz, 1011 = 100 MHz, 1101 = 90 MHz, 1111 = ??? MHz */
|
|
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
if (cpu_busspeed <= 0x40000000)
|
|
|
|
|
dev->readout_regs[1] |= 0x30;
|
|
|
|
|
else if ((cpu_busspeed > 0x40000000) && (cpu_busspeed <= 0x50000000))
|
|
|
|
|
dev->readout_regs[1] |= 0x00;
|
|
|
|
|
else if ((cpu_busspeed > 0x50000000) && (cpu_busspeed <= 0x60000000))
|
|
|
|
|
dev->readout_regs[1] |= 0x20;
|
|
|
|
|
else if (cpu_busspeed > 0x60000000)
|
|
|
|
|
dev->readout_regs[1] |= 0x10;
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
|
2020-03-23 02:59:50 +01:00
|
|
|
if (cpu_dmulti <= 1.5)
|
|
|
|
|
dev->readout_regs[1] |= 0x82;
|
|
|
|
|
else if ((cpu_dmulti > 1.5) && (cpu_dmulti <= 2.0))
|
|
|
|
|
dev->readout_regs[1] |= 0x02;
|
|
|
|
|
else if ((cpu_dmulti > 2.0) && (cpu_dmulti <= 2.5))
|
|
|
|
|
dev->readout_regs[1] |= 0x00;
|
|
|
|
|
else if (cpu_dmulti > 2.5)
|
|
|
|
|
dev->readout_regs[1] |= 0x80;
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
io_sethandler(0x0078, 0x0002, board_read, NULL, NULL, board_write, NULL, NULL, dev);
|
|
|
|
|
io_sethandler(0x00e0, 0x0002, board_read, NULL, NULL, board_write, NULL, NULL, dev);
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
dev->board_config[0] = 0xff;
|
|
|
|
|
/* Register 0x0079: */
|
2020-03-23 02:59:50 +01:00
|
|
|
/* Bit 7: 0 = Keep password, 0 = Clear password. */
|
2020-02-29 19:12:23 +01:00
|
|
|
/* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */
|
|
|
|
|
/* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */
|
2020-03-23 02:59:50 +01:00
|
|
|
/* Bit 4: External CPU clock (Switch 8). */
|
|
|
|
|
/* Bit 3: External CPU clock (Switch 7). */
|
|
|
|
|
/* 50 MHz: Switch 7 = Off, Switch 8 = Off. */
|
|
|
|
|
/* 60 MHz: Switch 7 = On, Switch 8 = Off. */
|
|
|
|
|
/* 66 MHz: Switch 7 = Off, Switch 8 = On. */
|
2020-02-29 19:12:23 +01:00
|
|
|
/* Bit 2: 0 = On-board audio absent, 1 = On-board audio present. */
|
2020-03-23 02:59:50 +01:00
|
|
|
/* Bit 0: 0 = 1.5x multiplier, 0 = 2x multiplier. */
|
|
|
|
|
dev->board_config[1] = 0xe0;
|
|
|
|
|
if ((cpu_s->rspeed == 75000000) && (cpu_busspeed == 50000000))
|
|
|
|
|
dev->board_config[1] |= 0x01;
|
|
|
|
|
else if ((cpu_s->rspeed == 90000000) && (cpu_busspeed == 60000000))
|
|
|
|
|
dev->board_config[1] |= (0x01 | 0x08);
|
|
|
|
|
else if ((cpu_s->rspeed == 100000000) && (cpu_busspeed == 50000000))
|
|
|
|
|
dev->board_config[1] |= 0x00;
|
|
|
|
|
else if ((cpu_s->rspeed == 100000000) && (cpu_busspeed == 66666666))
|
|
|
|
|
dev->board_config[1] |= (0x01 | 0x10);
|
|
|
|
|
else if ((cpu_s->rspeed == 120000000) && (cpu_busspeed == 60000000))
|
|
|
|
|
dev->board_config[1] |= 0x08;
|
|
|
|
|
else if ((cpu_s->rspeed == 133333333) && (cpu_busspeed == 66666666))
|
|
|
|
|
dev->board_config[1] |= 0x10;
|
|
|
|
|
else
|
|
|
|
|
dev->board_config[1] |= 0x10; /* TODO: how are the overdrive processors configured? */
|
2020-02-29 19:12:23 +01:00
|
|
|
|
2020-03-22 22:11:55 -03:00
|
|
|
smbus_init();
|
|
|
|
|
dev->smbus.stat = 0;
|
|
|
|
|
dev->smbus.ctl = 0;
|
|
|
|
|
dev->smbus.cmd = 0;
|
|
|
|
|
dev->smbus.addr = 0;
|
|
|
|
|
dev->smbus.data0 = 0;
|
|
|
|
|
dev->smbus.data1 = 0;
|
|
|
|
|
dev->smbus.index = 0;
|
|
|
|
|
for (i = 0; i < 32; i++)
|
|
|
|
|
dev->smbus.data[i] = 0;
|
|
|
|
|
timer_add(&dev->smbus.command_timer, smbus_inter, dev, 0);
|
|
|
|
|
|
2020-02-29 19:12:23 +01:00
|
|
|
return dev;
|
2016-06-26 00:34:39 +02:00
|
|
|
}
|
2018-04-25 23:51:13 +02:00
|
|
|
|
|
|
|
|
|
2020-03-24 22:43:58 +01:00
|
|
|
const device_t piix_device =
|
2018-04-25 23:51:13 +02:00
|
|
|
{
|
2020-03-24 22:43:58 +01:00
|
|
|
"Intel 82371FB (PIIX)",
|
2018-04-25 23:51:13 +02:00
|
|
|
DEVICE_PCI,
|
2020-03-24 22:43:58 +01:00
|
|
|
0x122e0101,
|
2018-04-25 23:51:13 +02:00
|
|
|
piix_init,
|
|
|
|
|
piix_close,
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
NULL,
|
2018-04-25 23:51:13 +02:00
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL
|
|
|
|
|
};
|
|
|
|
|
|
2020-03-24 22:43:58 +01:00
|
|
|
const device_t piix3_device =
|
2018-05-21 19:04:05 +02:00
|
|
|
{
|
2020-03-24 22:43:58 +01:00
|
|
|
"Intel 82371SB (PIIX3)",
|
2018-05-21 19:04:05 +02:00
|
|
|
DEVICE_PCI,
|
2020-03-24 22:43:58 +01:00
|
|
|
0x70000403,
|
2018-05-21 19:04:05 +02:00
|
|
|
piix_init,
|
|
|
|
|
piix_close,
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
NULL,
|
2018-05-21 19:04:05 +02:00
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL
|
|
|
|
|
};
|
|
|
|
|
|
2020-03-24 22:43:58 +01:00
|
|
|
const device_t piix4_device =
|
2018-04-25 23:51:13 +02:00
|
|
|
{
|
2020-03-24 22:43:58 +01:00
|
|
|
"Intel 82371AB/EB (PIIX4/PIIX4E)",
|
2018-04-25 23:51:13 +02:00
|
|
|
DEVICE_PCI,
|
2020-03-24 22:43:58 +01:00
|
|
|
0x71100004,
|
2020-02-29 19:12:23 +01:00
|
|
|
piix_init,
|
|
|
|
|
piix_close,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL
|
|
|
|
|
};
|
|
|
|
|
|
2020-03-24 22:43:58 +01:00
|
|
|
const device_t piix4e_device =
|
2020-02-29 19:12:23 +01:00
|
|
|
{
|
2020-03-24 22:43:58 +01:00
|
|
|
"Intel 82371EB (PIIX4E)",
|
2020-02-29 19:12:23 +01:00
|
|
|
DEVICE_PCI,
|
2020-03-24 22:43:58 +01:00
|
|
|
0x71100094,
|
2018-04-25 23:51:13 +02:00
|
|
|
piix_init,
|
|
|
|
|
piix_close,
|
Added the IBM 5161 ISA expansion for PC and XT;
Cleaned up the parallel port emulation, added IRQ support, and made enabling/disabling per port;
Added the Award 430NX and the Intel Classic/PCI (Alfredo, 420TX);
Finished the 586MC1;
Added 8087 emulation;
Moved Cyrix 6x86'es to the Dev branch;
Sanitized/cleaned up memregs.c/h and intel.c/h;
Split the chipsets from machines and sanitized Port 92 emulation;
Added support for the 15bpp mode to the Compaq ATI 28800;
Moved the MR 386DX and 486 machines to the Dev branch;
Ported the new dynamic recompiler from PCem, but it remains in Dev branch until after v2.00;
Ported the new timer code from PCem;
Cleaned up the CPU table of unused stuff and better optimized its structure;
Ported the Open-XT and Open-AT from VARCem, the Open-AT is in the Dev branch;
Ported the XT MFM controller rewrite and adding of more controllers (incl. two RLL ones), from VARCem;
Added the AHA-1540A and the BusTek BT-542B;
Moved the Sumo SCSI-AT to the Dev branch;
Minor IDE, FDC, and floppy drive code clean-ups;
Made NCR 5380/53C400-based cards' BIOS address configurable;
Got rid of the legacy romset variable;
Unified (video) buffer and buffer32 into one and make the unified buffer 32-bit;
Added the Amstead PPC512 per PCem patch by John Elliott;
Switched memory mapping granularity from 16k to 4k (less than 1k not possible due to internal pages);
Rewrote the CL-GD 54xx blitter, fixes Win-OS/2 on the 54x6 among other thing;
Added the Image Manager 1024 and Professional Graphics Controller per PCem patch by John Elliott and work done on VARCem;
Added Headland HT-216, GC-205 and Video 7 VGA 1024i emulation based on PCem commit;
Implemented the fuction keys for the Toshiba T1000/T1200/T3100 enhancement;
Amstrad MegaPC does now works correctly with non-internal graphics card;
The SLiRP code no longer casts a packed struct type to a non-packed struct type;
The Xi8088 and PB410a no longer hang on 86Box when PS/2 mouse is not present;
The S3 Virge on BeOS is no longer broken (was broken by build #1591);
OS/2 2.0 build 6.167 now sees key presses again;
Xi8088 now work on CGA again;
86F images converted from either the old or new variants of the HxC MFM format now work correctly;
Hardware interrupts with a vector of 0xFF are now handled correctly;
OPTi 495SX boards no longer incorrectly have 64 MB maximum RAM when 32 MB is correct;
Fixed VNC keyboard input bugs;
Fixed AT RTC periodic interrupt - Chicago 58s / 73f / 73g / 81 MIDI play no longer hangs with the build's own VTD driver;
Fixed mouse polling with internal mice - Amstrad and Olivetti mice now work correctly;
Triones ATAPI DMA driver now correctly reads a file at the end of a CD image with a sectors number not divisible by 4;
Compaq Portable now works with all graphics cards;
Fixed various MDSI Genius bugs;
Added segment limit checks and improved page fault checks for several CPU instructions - Memphis 15xx WINSETUP and Chicago 58s WINDISK.CPL no longer issue a GPF, and some S3 drivers that used to have glitches, now work correctly;
Further improved the 808x emulation, also fixes the noticably choppy sound when using 808x CPU's, also fixes #355;
OS/2 installer no logner locks up on splash screen on PS/2 Model 70 and 80, fixes #400.
Fixed several Amstead bugs, GEM no longer crashes on the Amstrad 1640, fixes #391.
Ported John Elliott's Amstrad fixes and improvement from PCem, and fixed the default language so it's correctly Engliish, fixes #278, fixes #389.
Fixed a minor IDE timing bug, fixes #388.
Fixed Toshiba T1000 RAM issues, fixes #379.
Fixed EGA/(S)VGA overscan border handling, fixes #378;
Got rid of the now long useless IDE channel 2 auto-removal, fixes #370;
Fixed the BIOS files used by the AMSTRAD PC1512, fixes #366;
Ported the Unicode CD image file name fix from VARCem, fixes #365;
Fixed high density floppy disks on the Xi8088, fixes #359;
Fixed some bugs in the Hercules emulation, fixes #346, fixes #358;
Fixed the SCSI hard disk mode sense pages, fixes #356;
Removed the AMI Unknown 386SX because of impossibility to identify the chipset, closes #349;
Fixed bugs in the serial mouse emulation, fixes #344;
Compiled 86Box binaries now include all the required .DLL's, fixes #341;
Made some combo boxes in the Settings dialog slightly wider, fixes #276.
2019-09-20 14:02:30 +02:00
|
|
|
NULL,
|
2018-04-25 23:51:13 +02:00
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL
|
|
|
|
|
};
|