2020-07-17 14:18:54 +03: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.
|
|
|
|
|
*
|
|
|
|
|
* This file is part of the 86Box distribution.
|
|
|
|
|
*
|
|
|
|
|
* Implementation of the VIA VT82C505 VL/PCI Bridge Controller.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
* Authors: Tiseno100,
|
|
|
|
|
* Miran Grca, <mgrca8@gmail.com>
|
2020-07-17 14:18:54 +03:00
|
|
|
*
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
* Copyright 2020 Tiseno100.
|
|
|
|
|
* Copyright 2020 Miran Grca.
|
2020-07-17 14:18:54 +03:00
|
|
|
*/
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <wchar.h>
|
|
|
|
|
#include <86box/86box.h>
|
|
|
|
|
#include <86box/mem.h>
|
|
|
|
|
#include <86box/io.h>
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
#include <86box/pic.h>
|
2020-07-17 14:18:54 +03:00
|
|
|
#include <86box/pci.h>
|
|
|
|
|
#include <86box/device.h>
|
|
|
|
|
#include <86box/chipset.h>
|
|
|
|
|
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
|
2020-07-17 14:18:54 +03:00
|
|
|
typedef struct vt82c505_t
|
|
|
|
|
{
|
2021-04-06 07:17:38 +02:00
|
|
|
uint8_t index;
|
|
|
|
|
uint8_t pci_conf[256];
|
2020-07-17 14:18:54 +03:00
|
|
|
} vt82c505_t;
|
|
|
|
|
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
|
2020-07-17 14:18:54 +03:00
|
|
|
static void
|
|
|
|
|
vt82c505_write(int func, int addr, uint8_t val, void *priv)
|
|
|
|
|
{
|
|
|
|
|
vt82c505_t *dev = (vt82c505_t *) priv;
|
2021-04-06 07:17:38 +02:00
|
|
|
uint8_t irq;
|
|
|
|
|
const uint8_t irq_array[8] = { 0, 5, 9, 10, 11, 14, 15, 0 };
|
2020-07-17 14:18:54 +03:00
|
|
|
|
2021-04-06 07:17:38 +02:00
|
|
|
if (func != 0)
|
|
|
|
|
return;
|
2020-07-17 14:18:54 +03:00
|
|
|
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
switch(addr) {
|
2021-04-06 07:17:38 +02:00
|
|
|
/* RX00-07h: Mandatory header field */
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
case 0x04:
|
2021-04-06 07:17:38 +02:00
|
|
|
dev->pci_conf[addr] = (dev->pci_conf[addr] & 0xbf) | (val & 0x40);
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
break;
|
|
|
|
|
case 0x07:
|
2021-04-06 07:17:38 +02:00
|
|
|
dev->pci_conf[addr] &= ~(val & 0x90);
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
break;
|
2020-07-17 14:18:54 +03:00
|
|
|
|
2021-04-06 07:17:38 +02:00
|
|
|
/* RX80-9F: VT82C505 internal configuration registers */
|
|
|
|
|
case 0x80:
|
|
|
|
|
dev->pci_conf[addr] = (dev->pci_conf[addr] & 0x0f) | (val & 0xf0);
|
|
|
|
|
break;
|
|
|
|
|
case 0x81: case 0x84: case 0x85: case 0x87:
|
|
|
|
|
case 0x88: case 0x89: case 0x8a: case 0x8b:
|
|
|
|
|
case 0x8c: case 0x8d: case 0x8e: case 0x8f:
|
|
|
|
|
case 0x92: case 0x94:
|
|
|
|
|
dev->pci_conf[addr] = val;
|
|
|
|
|
break;
|
|
|
|
|
case 0x82:
|
|
|
|
|
dev->pci_conf[addr] = val & 0xdb;
|
|
|
|
|
break;
|
|
|
|
|
case 0x83:
|
|
|
|
|
dev->pci_conf[addr] = val & 0xf9;
|
|
|
|
|
break;
|
|
|
|
|
case 0x86:
|
|
|
|
|
dev->pci_conf[addr] = val & 0xef;
|
|
|
|
|
/* Bit 7 switches between the two PCI configuration mechanisms:
|
|
|
|
|
0 = configuration mechanism 1, 1 = configuration mechanism 2 */
|
|
|
|
|
pci_set_pmc(!(val & 0x80));
|
|
|
|
|
break;
|
|
|
|
|
case 0x90:
|
|
|
|
|
dev->pci_conf[addr] = val;
|
|
|
|
|
irq = irq_array[val & 0x07];
|
|
|
|
|
if ((val & 0x08) && (irq != 0))
|
|
|
|
|
pci_set_irq_routing(PCI_INTC, irq);
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
else
|
|
|
|
|
pci_set_irq_routing(PCI_INTC, PCI_IRQ_DISABLED);
|
|
|
|
|
|
2021-04-06 07:17:38 +02:00
|
|
|
irq = irq_array[(val & 0x70) >> 4];
|
|
|
|
|
if ((val & 0x80) && (irq != 0))
|
|
|
|
|
pci_set_irq_routing(PCI_INTD, irq);
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
else
|
|
|
|
|
pci_set_irq_routing(PCI_INTD, PCI_IRQ_DISABLED);
|
|
|
|
|
break;
|
|
|
|
|
case 0x91:
|
2021-04-06 07:17:38 +02:00
|
|
|
dev->pci_conf[addr] = val;
|
|
|
|
|
irq = irq_array[val & 0x07];
|
|
|
|
|
if ((val & 0x08) && (irq != 0))
|
|
|
|
|
pci_set_irq_routing(PCI_INTA, irq);
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
else
|
|
|
|
|
pci_set_irq_routing(PCI_INTA, PCI_IRQ_DISABLED);
|
|
|
|
|
|
2021-04-06 07:17:38 +02:00
|
|
|
irq = irq_array[(val & 0x70) >> 4];
|
|
|
|
|
if ((val & 0x80) && (irq != 0))
|
|
|
|
|
pci_set_irq_routing(PCI_INTB, irq);
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
else
|
|
|
|
|
pci_set_irq_routing(PCI_INTB, PCI_IRQ_DISABLED);
|
|
|
|
|
break;
|
2021-04-06 07:17:38 +02:00
|
|
|
case 0x93:
|
|
|
|
|
dev->pci_conf[addr] = val & 0xe0;
|
|
|
|
|
break;
|
2020-07-17 14:18:54 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
|
2020-07-17 14:18:54 +03:00
|
|
|
static uint8_t
|
|
|
|
|
vt82c505_read(int func, int addr, void *priv)
|
|
|
|
|
{
|
|
|
|
|
vt82c505_t *dev = (vt82c505_t *) priv;
|
|
|
|
|
uint8_t ret = 0xff;
|
|
|
|
|
|
2021-04-06 07:17:38 +02:00
|
|
|
if (func != 0)
|
|
|
|
|
return ret;
|
|
|
|
|
|
2020-07-17 14:18:54 +03:00
|
|
|
ret = dev->pci_conf[addr];
|
|
|
|
|
|
2021-04-06 07:17:38 +02:00
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
vt82c505_out(uint16_t addr, uint8_t val, void *priv)
|
|
|
|
|
{
|
|
|
|
|
vt82c505_t *dev = (vt82c505_t *) priv;
|
|
|
|
|
|
|
|
|
|
if (addr == 0xa8)
|
|
|
|
|
dev->index = val;
|
|
|
|
|
else if ((addr == 0xa9) && (dev->index >= 0x80) && (dev->index <= 0x9f))
|
|
|
|
|
vt82c505_write(0, dev->index, val, priv);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static uint8_t
|
|
|
|
|
vt82c505_in(uint16_t addr, void *priv)
|
|
|
|
|
{
|
|
|
|
|
vt82c505_t *dev = (vt82c505_t *) priv;
|
|
|
|
|
uint8_t ret = 0xff;
|
|
|
|
|
|
|
|
|
|
if ((addr == 0xa9) && (dev->index >= 0x80) && (dev->index <= 0x9f))
|
|
|
|
|
ret = vt82c505_read(0, dev->index, priv);
|
|
|
|
|
|
2020-07-17 14:18:54 +03:00
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
|
2020-07-17 14:18:54 +03:00
|
|
|
static void
|
|
|
|
|
vt82c505_reset(void *priv)
|
|
|
|
|
{
|
2021-04-06 07:17:38 +02:00
|
|
|
vt82c505_t *dev = (vt82c505_t *) malloc(sizeof(vt82c505_t));
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
dev->pci_conf[0x04] = 0x07;
|
|
|
|
|
dev->pci_conf[0x07] = 0x00;
|
|
|
|
|
|
|
|
|
|
for (i = 0x80; i <= 0x9f; i++) {
|
|
|
|
|
switch (i) {
|
|
|
|
|
case 0x81:
|
|
|
|
|
vt82c505_write(0, i, 0x01, priv);
|
|
|
|
|
break;
|
|
|
|
|
case 0x84:
|
|
|
|
|
vt82c505_write(0, i, 0x03, priv);
|
|
|
|
|
break;
|
|
|
|
|
case 0x93:
|
|
|
|
|
vt82c505_write(0, i, 0x40, priv);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
vt82c505_write(0, i, 0x00, priv);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-07-17 14:18:54 +03:00
|
|
|
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
pic_reset();
|
2020-07-17 14:18:54 +03:00
|
|
|
}
|
|
|
|
|
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
|
2020-07-17 14:18:54 +03:00
|
|
|
static void
|
|
|
|
|
vt82c505_close(void *priv)
|
|
|
|
|
{
|
|
|
|
|
vt82c505_t *dev = (vt82c505_t *) priv;
|
|
|
|
|
|
|
|
|
|
free(dev);
|
|
|
|
|
}
|
|
|
|
|
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
|
2020-07-17 14:18:54 +03:00
|
|
|
static void *
|
|
|
|
|
vt82c505_init(const device_t *info)
|
|
|
|
|
{
|
|
|
|
|
vt82c505_t *dev = (vt82c505_t *) malloc(sizeof(vt82c505_t));
|
|
|
|
|
memset(dev, 0, sizeof(vt82c505_t));
|
|
|
|
|
|
2020-11-16 00:01:21 +01:00
|
|
|
pci_add_card(PCI_ADD_NORTHBRIDGE, vt82c505_read, vt82c505_write, dev);
|
2020-07-17 14:18:54 +03:00
|
|
|
|
|
|
|
|
dev->pci_conf[0x00] = 0x06;
|
|
|
|
|
dev->pci_conf[0x01] = 0x11;
|
|
|
|
|
dev->pci_conf[0x02] = 0x05;
|
|
|
|
|
dev->pci_conf[0x03] = 0x05;
|
|
|
|
|
dev->pci_conf[0x04] = 0x07;
|
2021-04-06 07:17:38 +02:00
|
|
|
dev->pci_conf[0x07] = 0x00;
|
2020-07-17 14:18:54 +03:00
|
|
|
dev->pci_conf[0x81] = 0x01;
|
|
|
|
|
dev->pci_conf[0x84] = 0x03;
|
|
|
|
|
dev->pci_conf[0x93] = 0x40;
|
|
|
|
|
|
2021-04-06 07:17:38 +02:00
|
|
|
io_sethandler(0x0a8, 0x0002, vt82c505_in, NULL, NULL, vt82c505_out, NULL, NULL, dev);
|
|
|
|
|
|
2020-07-17 14:18:54 +03:00
|
|
|
return dev;
|
|
|
|
|
}
|
|
|
|
|
|
PIC rewrite, proper SMRAM API, complete SiS 471 rewrite and addition of 40x, 460, and 461, changes to mem.c/h, disabled Voodoo memory dumping on exit, bumped SDL Hardware scale quality to 2, bumped IDE/ATAPI drives to ATA-6, finally bumped emulator version to 3.0, redid the bus type ID's to allow for planned ATAPI hard disks, made SST flash set its high mappings to the correct address if the CPU is 16-bit, and added the SiS 401 AMI 486 Clone, AOpen Vi15G, and the Soyo 4SA2 (486 with SiS 496/497 that can boot from CD-ROM), assorted 286+ protected mode fixes (for slightly more accuracy), and fixes to 808x emulation (MS Word 1.0 and 1.10 for DOS now work correctly from floppy).
2020-10-14 23:15:01 +02:00
|
|
|
|
2020-07-17 14:18:54 +03:00
|
|
|
const device_t via_vt82c505_device = {
|
|
|
|
|
"VIA VT82C505",
|
|
|
|
|
DEVICE_PCI,
|
|
|
|
|
0,
|
|
|
|
|
vt82c505_init,
|
|
|
|
|
vt82c505_close,
|
|
|
|
|
vt82c505_reset,
|
2020-11-16 00:01:21 +01:00
|
|
|
{ NULL },
|
2020-07-17 14:18:54 +03:00
|
|
|
NULL,
|
|
|
|
|
NULL,
|
|
|
|
|
NULL
|
|
|
|
|
};
|