# Conflicts:
#	src/chipset/via_pipc.c
This commit is contained in:
RichardG867
2020-10-29 14:07:05 -03:00
28 changed files with 1824 additions and 1550 deletions

19
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,19 @@
Summary
=======
_Briefly describe what you are submitting._
Approach
========
_How did you address the problem?_
Checklist
=========
* [ ] Closes issue #xxx
* [ ] I have discussed this with core contributors already
* [ ] This pull request requires inclusion of a ROM in the romset
* [ ] I have opened a roms pull request - https://github.com/86Box/roms/pull/changeme/
* [ ] My commit messages are descriptive and I have not added any irrelevant files to the repository
References
==========
_Provide links to datasheets or other documentation that helped you implement this pull request._

View File

@@ -35,10 +35,14 @@
#include <86box/chipset.h>
#include <86box/spd.h>
#define VIA_597 0x05970100
#define VIA_598 0x05980000
#define VIA_691 0x06910000
#define VIA_8601 0x86010500
typedef struct via_apollo_t
{
uint16_t id;
uint32_t id;
uint8_t pci_conf[256];
smram_t *smram;
@@ -84,8 +88,8 @@ via_apollo_setup(via_apollo_t *dev)
/* Host Bridge */
dev->pci_conf[0x00] = 0x06; /*VIA*/
dev->pci_conf[0x01] = 0x11;
dev->pci_conf[0x02] = dev->id & 0xff;
dev->pci_conf[0x03] = (dev->id >> 8);
dev->pci_conf[0x02] = dev->id >> 16;
dev->pci_conf[0x03] = dev->id >> 24;
dev->pci_conf[0x04] = 6;
dev->pci_conf[0x05] = 0;
@@ -93,8 +97,7 @@ via_apollo_setup(via_apollo_t *dev)
dev->pci_conf[0x06] = 0x90;
dev->pci_conf[0x07] = 0x02;
if (dev->id == 0x0597)
dev->pci_conf[0x08] = 1; /* Production Silicon ("Revision B") */
dev->pci_conf[0x08] = dev->id >> 8;
dev->pci_conf[0x09] = 0;
dev->pci_conf[0x0a] = 0;
dev->pci_conf[0x0b] = 6;
@@ -105,7 +108,9 @@ via_apollo_setup(via_apollo_t *dev)
dev->pci_conf[0x10] = 0x08;
dev->pci_conf[0x34] = 0xa0;
if (dev->id == 0x0691) {
if (dev->id == VIA_8601)
dev->pci_conf[0x52] = 0x10;
if (dev->id == VIA_691) {
dev->pci_conf[0x56] = 0x01;
dev->pci_conf[0x57] = 0x01;
}
@@ -119,7 +124,7 @@ via_apollo_setup(via_apollo_t *dev)
dev->pci_conf[0x64] = 0xec;
dev->pci_conf[0x65] = 0xec;
dev->pci_conf[0x66] = 0xec;
if (dev->id == 0x0691)
if (dev->id == VIA_691)
dev->pci_conf[0x67] = 0xec; /* DRAM Timing for Banks 6,7. */
dev->pci_conf[0x6b] = 0x01;
@@ -138,7 +143,7 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv)
if (func)
return;
/*Read-only addresses*/
if ((addr < 4) || ((addr >= 5) && (addr < 7)) || ((addr >= 8) && (addr < 0xd)) ||
((addr >= 0xe) && (addr < 0x12)) || ((addr >= 0x14) && (addr < 0x50)) ||
@@ -148,9 +153,9 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv)
((addr >= 0xad) && (addr < 0xf0)) || ((addr >= 0xf8) && (addr < 0xfc)) ||
(addr == 0xfd))
return;
if (((addr == 0x78) || (addr >= 0xad)) && (dev->id == 0x0597))
if (((addr == 0x78) || (addr >= 0xad)) && (dev->id == VIA_597))
return;
if (((addr == 0x67) || ((addr >= 0xf0) && (addr < 0xfc))) && (dev->id != 0x0691))
if (((addr == 0x67) || ((addr >= 0xf0) && (addr < 0xfc))) && (dev->id != VIA_691))
return;
switch(addr) {
@@ -161,7 +166,11 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv)
dev->pci_conf[0x07] &= ~(val & 0xb0);
break;
case 0x0d:
if(dev->id == VIA_8601)
dev->pci_conf[0x0d] = (dev->pci_conf[0x0d] & ~0x07) | (val & 0x07);
else
dev->pci_conf[0x0d] = (dev->pci_conf[0x0d] & ~0x07) | (val & 0x07);
dev->pci_conf[0x75] = (dev->pci_conf[0x75] & ~0x30) | ((val & 0x06) << 3);
break;
@@ -173,45 +182,51 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv)
break;
case 0x50: /* Cache Control 1 */
if (dev->id == 0x0691)
if (dev->id == VIA_8601)
dev->pci_conf[0x50] = (dev->pci_conf[0x50] & ~0xd3) | (val & 0xd3);
else if (dev->id == VIA_691)
dev->pci_conf[0x50] = val;
else
dev->pci_conf[0x50] = (dev->pci_conf[0x50] & ~0xf8) | (val & 0xf8);
break;
case 0x51: /* Cache Control 2 */
if (dev->id == 0x0691)
if (dev->id >= VIA_691)
dev->pci_conf[0x51] = val;
else
dev->pci_conf[0x51] = (dev->pci_conf[0x51] & ~0xeb) | (val & 0xeb);
break;
case 0x52: /* Non_Cacheable Control */
if (dev->id == 0x0691)
if (dev->id == VIA_8601)
dev->pci_conf[0x52] = (dev->pci_conf[0x52] & ~0xdf) | (val & 0xdf);
else if (dev->id == VIA_691)
dev->pci_conf[0x52] = (dev->pci_conf[0x52] & ~0x9f) | (val & 0x9f);
else
dev->pci_conf[0x52] = (dev->pci_conf[0x52] & ~0xf5) | (val & 0xf5);
break;
case 0x53: /* System Performance Control */
if (dev->id == 0x0691)
if (dev->id == VIA_8601)
dev->pci_conf[0x53] = (dev->pci_conf[0x53] & ~0xfc) | (val & 0xfc);
else if (dev->id == VIA_691)
dev->pci_conf[0x53] = val;
else
dev->pci_conf[0x53] = (dev->pci_conf[0x53] & ~0xf0) | (val & 0xf0);
break;
case 0x56: case 0x57: case 0x5a: case 0x5b: case 0x5c: case 0x5d: case 0x5e: case 0x5f: /* DRAM Row Ending Address */
if (dev->id >= 0x0691)
if (dev->id >= VIA_691)
spd_write_drbs(dev->pci_conf, 0x5a, 0x56, 8);
else if (addr >= 0x5a)
spd_write_drbs(dev->pci_conf, 0x5a, 0x5f, 8);
break;
case 0x58:
if (dev->id == 0x0597)
if ((dev->id == VIA_597) || (dev->id == VIA_8601))
dev->pci_conf[0x58] = (dev->pci_conf[0x58] & ~0xee) | (val & 0xee);
else
dev->pci_conf[0x58] = val;
break;
case 0x59:
if (dev->id == 0x0691)
if (dev->id == VIA_691)
dev->pci_conf[0x59] = val;
else
dev->pci_conf[0x59] = (dev->pci_conf[0x59] & ~0xf0) | (val & 0xf0);
@@ -248,7 +263,7 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv)
apollo_map(0xe0000, 0x10000, (val & 0xc0) >> 6);
dev->pci_conf[0x63] = val;
smram_disable_all();
if (dev->id == 0x0691) switch (val & 0x03) {
if (dev->id >= VIA_691) switch (val & 0x03) {
case 0x00:
default:
apollo_smram_map(dev, 1, 0x000a0000, 0x00020000, 1); /* SMM: Code DRAM, Data DRAM */
@@ -271,21 +286,21 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv)
default:
/* Disable SMI Address Redirection (default) */
apollo_smram_map(dev, 1, 0x000a0000, 0x00020000, 0);
if (dev->id == 0x0597)
if (dev->id == VIA_597)
apollo_smram_map(dev, 1, 0x00030000, 0x00020000, 1);
apollo_smram_map(dev, 0, 0x000a0000, 0x00020000, 0);
break;
case 0x01:
/* Allow access to DRAM Axxxx-Bxxxx for both normal and SMI cycles */
apollo_smram_map(dev, 1, 0x000a0000, 0x00020000, 1);
if (dev->id == 0x0597)
if (dev->id == VIA_597)
apollo_smram_map(dev, 1, 0x00030000, 0x00020000, 1);
apollo_smram_map(dev, 0, 0x000a0000, 0x00020000, 1);
break;
case 0x02:
/* Reserved */
apollo_smram_map(dev, 1, 0x000a0000, 0x00020000, 3);
if (dev->id == 0x0597) {
if (dev->id == VIA_597) {
/* SMI 3xxxx-4xxxx redirect to Axxxx-Bxxxx. */
apollo_smram_map(dev, 1, 0x00030000, 0x00020000, 1);
}
@@ -294,38 +309,46 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv)
case 0x03:
/* Allow SMI Axxxx-Bxxxx DRAM access */
apollo_smram_map(dev, 1, 0x000a0000, 0x00020000, 1);
if (dev->id == 0x0597)
if (dev->id == VIA_597)
apollo_smram_map(dev, 1, 0x00030000, 0x00020000, 1);
apollo_smram_map(dev, 0, 0x000a0000, 0x00020000, 0);
break;
}
break;
case 0x68:
if (dev->id == 0x0597)
if (dev->id == VIA_597)
dev->pci_conf[0x68] = (dev->pci_conf[0x6b] & ~0xfe) | (val & 0xfe);
else if (dev->id == 0x0598)
else if ((dev->id == VIA_598) || (dev->id == VIA_8601))
dev->pci_conf[0x68] = val;
else
dev->pci_conf[0x68] = (dev->pci_conf[0x6b] & ~0xfd) | (val & 0xfd);
break;
case 0x69:
if (dev->id == VIA_8601)
dev->pci_conf[0x69] = (dev->pci_conf[0x69] & ~0xfe) | (val & 0xfe);
else
dev->pci_conf[0x69] = val;
break;
case 0x6b:
if (dev->id == 0x0691)
if (dev->id == VIA_8601)
dev->pci_conf[0x6b] = val;
else if (dev->id == VIA_691)
dev->pci_conf[0x6b] = (dev->pci_conf[0x6b] & ~0xcf) | (val & 0xcf);
else
dev->pci_conf[0x6b] = (dev->pci_conf[0x6b] & ~0xc1) | (val & 0xc1);
break;
case 0x6c:
if (dev->id == 0x0597)
if ((dev->id == VIA_597) || (dev->id == VIA_8601))
dev->pci_conf[0x6c] = (dev->pci_conf[0x6c] & ~0x1f) | (val & 0x1f);
else if (dev->id == 0x0598)
else if (dev->id == VIA_598)
dev->pci_conf[0x6c] = (dev->pci_conf[0x6c] & ~0x7f) | (val & 0x7f);
else
dev->pci_conf[0x6c] = val;
break;
case 0x6d:
if (dev->id == 0x0597)
if (dev->id == VIA_597)
dev->pci_conf[0x6d] = (dev->pci_conf[0x6d] & ~0x0f) | (val & 0x0f);
else if (dev->id == 0x0598)
else if ((dev->id == VIA_598) || (dev->id == VIA_8601))
dev->pci_conf[0x6d] = (dev->pci_conf[0x6d] & ~0x7f) | (val & 0x7f);
else
dev->pci_conf[0x6d] = val;
@@ -335,24 +358,52 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv)
break;
case 0x70:
if (dev->id == 0x0597)
if (dev->id == VIA_8601)
dev->pci_conf[0x70] = (dev->pci_conf[0x70] & ~0xdf) | (val & 0xdf);
else if (dev->id == VIA_597)
dev->pci_conf[0x70] = (dev->pci_conf[0x70] & ~0xf1) | (val & 0xf1);
else
dev->pci_conf[0x70] = val;
break;
case 0x73:
if (dev->id == VIA_8601)
dev->pci_conf[0x73] = (dev->pci_conf[0x73] & ~0x7f) | (val & 0x7f);
else
dev->pci_conf[0x73] = val;
break;
case 0x74:
dev->pci_conf[0x74] = (dev->pci_conf[0x74] & ~0xc0) | (val & 0xc0);
if (dev->id == VIA_8601)
dev->pci_conf[0x74] = (dev->pci_conf[0x74] & ~0xdf) | (val & 0xdf);
else
dev->pci_conf[0x74] = (dev->pci_conf[0x74] & ~0xc0) | (val & 0xc0);
break;
case 0x75:
dev->pci_conf[0x75] = (dev->pci_conf[0x75] & ~0xcf) | (val & 0xcf);
if (dev->id == VIA_8601)
dev->pci_conf[0x75] = val;
else
dev->pci_conf[0x75] = (dev->pci_conf[0x75] & ~0xcf) | (val & 0xcf);
break;
case 0x76:
dev->pci_conf[0x76] = (dev->pci_conf[0x76] & ~0xf0) | (val & 0xf0);
if (dev->id == VIA_8601)
dev->pci_conf[0x75] = val;
else
dev->pci_conf[0x76] = (dev->pci_conf[0x76] & ~0xf0) | (val & 0xf0);
break;
case 0x77:
if (dev->id != VIA_8601)
dev->pci_conf[0x77] = (dev->pci_conf[0x77] & ~0xc0) | (val & 0xc0);
break;
case 0x78:
dev->pci_conf[0x78] = (dev->pci_conf[0x78] & ~0xd5) | (val & 0xd5);
break;
case 0x79:
dev->pci_conf[0x79] = (dev->pci_conf[0x79] & ~0xfc) | (val & 0xfc);
break;
case 0x7a:
dev->pci_conf[0x7a] = (dev->pci_conf[0x7a] & ~0x89) | (val & 0x89);
break;
case 0x7e:
if (dev->id != VIA_8601)
dev->pci_conf[0x7e] = (dev->pci_conf[0x7e] & ~0x3f) | (val & 0x3f);
break;
@@ -361,14 +412,25 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv)
break;
case 0x84:
/* The datasheet first mentions 7-0 but then says 3-0 are reserved -
- minimum of 16 MB for the graphics aperture? */
dev->pci_conf[0x84] = (dev->pci_conf[0x84] & ~0xf0) | (val & 0xf0);
- minimum of 16 MB for the graphics aperture? 8601 datasheet doesn't refer it. */
if(dev->id == VIA_8601)
dev->pci_conf[0x84] = val;
else
dev->pci_conf[0x84] = (dev->pci_conf[0x84] & ~0xf0) | (val & 0xf0);
break;
case 0x88:
dev->pci_conf[0x88] = (dev->pci_conf[0x88] & ~0x07) | (val & 0x07);
if(dev->id == VIA_8601)
dev->pci_conf[0x88] = (dev->pci_conf[0x88] & ~0x06) | (val & 0x06);
else
dev->pci_conf[0x88] = (dev->pci_conf[0x88] & ~0x07) | (val & 0x07);
break;
case 0x89:
dev->pci_conf[0x89] = (dev->pci_conf[0x89] & ~0xf0) | (val & 0xf0);
case 0x8a:
case 0x8b:
if(dev->id == VIA_8601)
dev->pci_conf[addr] = val;
else
dev->pci_conf[0x89] = (dev->pci_conf[0x89] & ~0xf0) | (val & 0xf0);
break;
case 0xa8:
@@ -378,13 +440,29 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv)
dev->pci_conf[0xa9] = (dev->pci_conf[0xa9] & ~0x03) | (val & 0x03);
break;
case 0xac:
if(dev->id == VIA_8601)
dev->pci_conf[0xac] = (dev->pci_conf[0xac] & ~0x7f) | (val & 0x7f);
else
dev->pci_conf[0xac] = (dev->pci_conf[0xac] & ~0x0f) | (val & 0x0f);
break;
case 0xad:
dev->pci_conf[0xac] = (dev->pci_conf[0xac] & ~0x0f) | (val & 0x0f);
break;
case 0xfc:
if (dev->id > 0x0597)
if (dev->id == VIA_8601)
dev->pci_conf[0xfc] = (dev->pci_conf[0xfc] & ~0x03) | (val & 0x03);
else if (dev->id > VIA_597)
dev->pci_conf[0xfc] = (dev->pci_conf[0xfc] & ~0x01) | (val & 0x01);
break;
case 0xfd:
if (dev->id == VIA_8601)
dev->pci_conf[0xfd] = (dev->pci_conf[0xfd] & ~0x07) | (val & 0x07);
else
dev->pci_conf[0xfd] = val;
break;
default:
dev->pci_conf[addr] = val;
break;
@@ -442,17 +520,21 @@ via_apollo_init(const device_t *info)
dev->id = info->local;
switch (dev->id) {
case 0x0597:
case VIA_597:
device_add(&via_vp3_agp_device);
break;
case 0x0598:
case VIA_598:
device_add(&via_mvp3_agp_device);
break;
case 0x0691:
case VIA_691:
device_add(&via_apro_agp_device);
break;
case VIA_8601:
device_add(&via_vt8601_agp_device);
break;
}
via_apollo_setup(dev);
@@ -477,7 +559,7 @@ const device_t via_vp3_device =
{
"VIA Apollo VP3",
DEVICE_PCI,
0x0597, /*VT82C597*/
VIA_597, /*VT82C597*/
via_apollo_init,
via_apollo_close,
via_apollo_reset,
@@ -491,7 +573,7 @@ const device_t via_mvp3_device =
{
"VIA Apollo MVP3",
DEVICE_PCI,
0x0598, /*VT82C598MVP*/
VIA_598, /*VT82C598MVP*/
via_apollo_init,
via_apollo_close,
via_apollo_reset,
@@ -504,7 +586,20 @@ const device_t via_mvp3_device =
const device_t via_apro_device = {
"VIA Apollo Pro",
DEVICE_PCI,
0x0691, /*VT82C691*/
VIA_691, /*VT82C691*/
via_apollo_init,
via_apollo_close,
via_apollo_reset,
NULL,
NULL,
NULL,
NULL
};
const device_t via_vt8601_device = {
"VIA Apollo ProMedia",
DEVICE_PCI,
VIA_8601, /*VT8601*/
via_apollo_init,
via_apollo_close,
via_apollo_reset,

View File

@@ -54,7 +54,6 @@
#include <86box/sio.h>
#include <86box/hwm.h>
/* Most revision numbers (PCI-ISA bridge or otherwise) were lifted from PCI device
listings on forums, as VIA's datasheets are not very helpful regarding those. */
#define VIA_PIPC_586A 0x05862500
@@ -268,8 +267,9 @@ pipc_reset_hard(void *priv)
dev->power_regs[0x08] = 0x40;
break;
}
if (dev->local >= VIA_PIPC_686A)
dev->power_regs[0x42] = 0x40; /* external suspend-related pin, must be set */
dev->power_regs[0x40] = 0x20;
dev->power_regs[0x42] = 0xd0;
dev->power_regs[0x48] = 0x01;
if (dev->local >= VIA_PIPC_686A)
@@ -761,7 +761,7 @@ pipc_write(int func, int addr, uint8_t val, void *priv)
break;
case 0x42:
dev->power_regs[addr] = val & 0x0f;
dev->power_regs[addr] = (dev->power_regs[0x42] & ~0x0f) | (val & 0x0f);
acpi_set_irq_line(dev->acpi, dev->power_regs[addr]);
pclog("VIA SCI: %d\n", dev->power_regs[addr]);
break;

View File

@@ -538,6 +538,7 @@ CPU cpus_PentiumS5[] = {
{"Pentium 100/50", CPU_PENTIUM, fpus_internal, 100000000, 2.0, 0x524, 0x524, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 10,10,6,6, 12},
{"Pentium 100/66", CPU_PENTIUM, fpus_internal, 100000000, 1.5, 0x526, 0x526, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 9, 9,4,4, 12},
{"Pentium 120", CPU_PENTIUM, fpus_internal, 120000000, 2.0, 0x526, 0x526, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12,6,6, 14},
{"Pentium 133", CPU_PENTIUM, fpus_internal, 133333333, 2.0, 0x52c, 0x52c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12,6,6, 16},
/*Intel Pentium OverDrive*/
{"Pentium OverDrive 125", CPU_PENTIUM, fpus_internal, 125000000, 3.0, 0x52c, 0x52c, 0, CPU_SUPPORTS_DYNAREC | CPU_REQUIRES_DYNAREC, 12,12,7,7, 16},

View File

@@ -39,6 +39,7 @@
#define AGP_BRIDGE_VIA_597 0x11068597
#define AGP_BRIDGE_VIA_598 0x11068598
#define AGP_BRIDGE_VIA_691 0x11068691
#define AGP_BRIDGE_VIA_8601 0x11068601
#define AGP_BRIDGE_VIA(x) (((x) >> 16) == 0x1106)
#define AGP_BRIDGE(x) ((x) >= AGP_BRIDGE_VIA_597)
@@ -227,6 +228,7 @@ pci_bridge_reset(void *priv)
case AGP_BRIDGE_VIA_597:
case AGP_BRIDGE_VIA_598:
case AGP_BRIDGE_VIA_691:
case AGP_BRIDGE_VIA_8601:
dev->regs[0x04] = 0x07;
dev->regs[0x06] = 0x20;
dev->regs[0x07] = 0x02;
@@ -406,3 +408,17 @@ const device_t via_apro_agp_device =
NULL,
NULL
};
const device_t via_vt8601_agp_device =
{
"VIA Apollo ProMedia AGP Bridge",
DEVICE_PCI,
AGP_BRIDGE_VIA_8601,
pci_bridge_init,
NULL,
pci_bridge_reset,
NULL,
NULL,
NULL,
NULL
};

View File

@@ -120,6 +120,7 @@ extern const device_t via_vpx_device;
extern const device_t via_vp3_device;
extern const device_t via_mvp3_device;
extern const device_t via_apro_device;
extern const device_t via_vt8601_device;
extern const device_t via_vt82c586b_device;
extern const device_t via_vt82c596_device;
extern const device_t via_vt82c596b_device;

View File

@@ -1,186 +1,5 @@
#define NCoef 2
/* fc=350Hz */
static inline float low_iir(int i, float NewSample) {
float ACoef[NCoef+1] = {
0.00049713569693400649,
0.00099427139386801299,
0.00049713569693400649
};
float BCoef[NCoef+1] = {
1.00000000000000000000,
-1.93522955470669530000,
0.93726236021404663000
};
static float y[2][NCoef+1]; /* output samples */
static float x[2][NCoef+1]; /* input samples */
int n;
/* shift the old samples */
for(n=NCoef; n>0; n--) {
x[i][n] = x[i][n-1];
y[i][n] = y[i][n-1];
}
/* Calculate the new output */
x[i][0] = NewSample;
y[i][0] = ACoef[0] * x[i][0];
for(n=1; n<=NCoef; n++)
y[i][0] += ACoef[n] * x[i][n] - BCoef[n] * y[i][n];
return y[i][0];
}
/* fc=350Hz */
static inline float low_cut_iir(int i, float NewSample) {
float ACoef[NCoef+1] = {
0.96839970114733542000,
-1.93679940229467080000,
0.96839970114733542000
};
float BCoef[NCoef+1] = {
1.00000000000000000000,
-1.93522955471202770000,
0.93726236021916731000
};
static float y[2][NCoef+1]; /* output samples */
static float x[2][NCoef+1]; /* input samples */
int n;
/* shift the old samples */
for(n=NCoef; n>0; n--) {
x[i][n] = x[i][n-1];
y[i][n] = y[i][n-1];
}
/* Calculate the new output */
x[i][0] = NewSample;
y[i][0] = ACoef[0] * x[i][0];
for(n=1; n<=NCoef; n++)
y[i][0] += ACoef[n] * x[i][n] - BCoef[n] * y[i][n];
return y[i][0];
}
/* fc=3.5kHz */
static inline float high_iir(int i, float NewSample) {
float ACoef[NCoef+1] = {
0.72248704753064896000,
-1.44497409506129790000,
0.72248704753064896000
};
float BCoef[NCoef+1] = {
1.00000000000000000000,
-1.36640781670578510000,
0.52352474706139873000
};
static float y[2][NCoef+1]; /* output samples */
static float x[2][NCoef+1]; /* input samples */
int n;
/* shift the old samples */
for(n=NCoef; n>0; n--) {
x[i][n] = x[i][n-1];
y[i][n] = y[i][n-1];
}
/* Calculate the new output */
x[i][0] = NewSample;
y[i][0] = ACoef[0] * x[i][0];
for(n=1; n<=NCoef; n++)
y[i][0] += ACoef[n] * x[i][n] - BCoef[n] * y[i][n];
return y[i][0];
}
/* fc=3.5kHz */
static inline float high_cut_iir(int i, float NewSample) {
float ACoef[NCoef+1] = {
0.03927726802250377400,
0.07855453604500754700,
0.03927726802250377400
};
float BCoef[NCoef+1] = {
1.00000000000000000000,
-1.36640781666419950000,
0.52352474703279628000
};
static float y[2][NCoef+1]; /* output samples */
static float x[2][NCoef+1]; /* input samples */
int n;
/* shift the old samples */
for(n=NCoef; n>0; n--) {
x[i][n] = x[i][n-1];
y[i][n] = y[i][n-1];
}
/* Calculate the new output */
x[i][0] = NewSample;
y[i][0] = ACoef[0] * x[i][0];
for(n=1; n<=NCoef; n++)
y[i][0] += ACoef[n] * x[i][n] - BCoef[n] * y[i][n];
return y[i][0];
}
#undef NCoef
#define NCoef 2
/* fc=3.2kHz */
static inline float sb_iir(int i, float NewSample) {
float ACoef[NCoef+1] = {
0.03356837051492005100,
0.06713674102984010200,
0.03356837051492005100
};
float BCoef[NCoef+1] = {
1.00000000000000000000,
-1.41898265221812010000,
0.55326988968868285000
};
/* float ACoef[NCoef+1] = {
0.17529642630084405000,
0.17529642630084405000
};
float BCoef[NCoef+1] = {
1.00000000000000000000,
-0.64940759319751051000
};*/
static float y[2][NCoef+1]; /* output samples */
static float x[2][NCoef+1]; /* input samples */
int n;
/* shift the old samples */
for(n=NCoef; n>0; n--) {
x[i][n] = x[i][n-1];
y[i][n] = y[i][n-1];
}
/* Calculate the new output */
x[i][0] = NewSample;
y[i][0] = ACoef[0] * x[i][0];
for(n=1; n<=NCoef; n++)
y[i][0] += ACoef[n] * x[i][n] - BCoef[n] * y[i][n];
return y[i][0];
}
#undef NCoef
#define NCoef 2
/* fc=150Hz */
static inline float adgold_highpass_iir(int i, float NewSample) {
float ACoef[NCoef+1] = {
@@ -347,30 +166,204 @@ static inline float dac_iir(int i, float NewSample) {
}
#undef NCoef
#define NCoef 2
/* fc=350Hz */
static inline double low_iir(int c, int i, double NewSample) {
double ACoef[NCoef+1] = {
0.00049713569693400649,
0.00099427139386801299,
0.00049713569693400649
};
double BCoef[NCoef+1] = {
1.00000000000000000000,
-1.93522955470669530000,
0.93726236021404663000
};
static double y[2][2][NCoef+1]; /* output samples */
static double x[2][2][NCoef+1]; /* input samples */
int n;
/* shift the old samples */
for(n=NCoef; n>0; n--) {
x[c][i][n] = x[c][i][n-1];
y[c][i][n] = y[c][i][n-1];
}
/* Calculate the new output */
x[c][i][0] = NewSample;
y[c][i][0] = ACoef[0] * x[c][i][0];
for(n=1; n<=NCoef; n++)
y[c][i][0] += ACoef[n] * x[c][i][n] - BCoef[n] * y[c][i][n];
return y[c][i][0];
}
/* fc=350Hz */
static inline double low_cut_iir(int c, int i, double NewSample) {
double ACoef[NCoef+1] = {
0.96839970114733542000,
-1.93679940229467080000,
0.96839970114733542000
};
double BCoef[NCoef+1] = {
1.00000000000000000000,
-1.93522955471202770000,
0.93726236021916731000
};
static double y[2][2][NCoef+1]; /* output samples */
static double x[2][2][NCoef+1]; /* input samples */
int n;
/* shift the old samples */
for(n=NCoef; n>0; n--) {
x[c][i][n] = x[c][i][n-1];
y[c][i][n] = y[c][i][n-1];
}
/* Calculate the new output */
x[c][i][0] = NewSample;
y[c][i][0] = ACoef[0] * x[c][i][0];
for(n=1; n<=NCoef; n++)
y[c][i][0] += ACoef[n] * x[c][i][n] - BCoef[n] * y[c][i][n];
return y[c][i][0];
}
/* fc=3.5kHz */
static inline double high_iir(int c, int i, double NewSample) {
double ACoef[NCoef+1] = {
0.72248704753064896000,
-1.44497409506129790000,
0.72248704753064896000
};
double BCoef[NCoef+1] = {
1.00000000000000000000,
-1.36640781670578510000,
0.52352474706139873000
};
static double y[2][2][NCoef+1]; /* output samples */
static double x[2][2][NCoef+1]; /* input samples */
int n;
/* shift the old samples */
for(n=NCoef; n>0; n--) {
x[c][i][n] = x[c][i][n-1];
y[c][i][n] = y[c][i][n-1];
}
/* Calculate the new output */
x[c][i][0] = NewSample;
y[c][i][0] = ACoef[0] * x[c][i][0];
for(n=1; n<=NCoef; n++)
y[c][i][0] += ACoef[n] * x[c][i][n] - BCoef[n] * y[c][i][n];
return y[c][i][0];
}
/* fc=3.5kHz */
static inline double high_cut_iir(int c, int i, double NewSample) {
double ACoef[NCoef+1] = {
0.03927726802250377400,
0.07855453604500754700,
0.03927726802250377400
};
double BCoef[NCoef+1] = {
1.00000000000000000000,
-1.36640781666419950000,
0.52352474703279628000
};
static double y[2][2][NCoef+1]; /* output samples */
static double x[2][2][NCoef+1]; /* input samples */
int n;
/* shift the old samples */
for(n=NCoef; n>0; n--) {
x[c][i][n] = x[c][i][n-1];
y[c][i][n] = y[c][i][n-1];
}
/* Calculate the new output */
x[c][i][0] = NewSample;
y[c][i][0] = ACoef[0] * x[c][i][0];
for(n=1; n<=NCoef; n++)
y[c][i][0] += ACoef[n] * x[c][i][n] - BCoef[n] * y[c][i][n];
return y[c][i][0];
}
#undef NCoef
#define NCoef 2
/* fc=3.2kHz */
static inline double sb_iir(int c, int i, double NewSample) {
double ACoef[NCoef+1] = {
0.03356837051492005100,
0.06713674102984010200,
0.03356837051492005100
};
double BCoef[NCoef+1] = {
1.00000000000000000000,
-1.41898265221812010000,
0.55326988968868285000
};
static double y[2][2][NCoef+1]; /* output samples */
static double x[2][2][NCoef+1]; /* input samples */
int n;
/* shift the old samples */
for(n=NCoef; n>0; n--) {
x[c][i][n] = x[c][i][n-1];
y[c][i][n] = y[c][i][n-1];
}
/* Calculate the new output */
x[c][i][0] = NewSample;
y[c][i][0] = ACoef[0] * x[c][i][0];
for(n=1; n<=NCoef; n++)
y[c][i][0] += ACoef[n] * x[c][i][n] - BCoef[n] * y[c][i][n];
return y[c][i][0];
}
#undef NCoef
#define NCoef 1
#define SB16_NCoef 51
extern float low_fir_sb16_coef[SB16_NCoef];
extern double low_fir_sb16_coef[2][SB16_NCoef];
static inline float low_fir_sb16(int i, float NewSample)
static inline double low_fir_sb16(int c, int i, double NewSample)
{
static float x[2][SB16_NCoef+1]; //input samples
static int pos = 0;
float out = 0.0;
static double x[2][2][SB16_NCoef+1]; //input samples
static int pos[2] = { 0, 0 };
double out = 0.0;
int n;
/* Calculate the new output */
x[i][pos] = NewSample;
x[c][i][pos[c]] = NewSample;
for (n = 0; n < ((SB16_NCoef+1)-pos) && n < SB16_NCoef; n++)
out += low_fir_sb16_coef[n] * x[i][n+pos];
for (n = 0; n < ((SB16_NCoef+1)-pos[c]) && n < SB16_NCoef; n++)
out += low_fir_sb16_coef[c][n] * x[c][i][n+pos[c]];
for (; n < SB16_NCoef; n++)
out += low_fir_sb16_coef[n] * x[i][(n+pos) - (SB16_NCoef+1)];
out += low_fir_sb16_coef[c][n] * x[c][i][(n+pos[c]) - (SB16_NCoef+1)];
if (i == 1)
{
pos++;
if (pos > SB16_NCoef)
pos = 0;
pos[c]++;
if (pos[c] > SB16_NCoef)
pos[c] = 0;
}
return out;

View File

@@ -314,6 +314,7 @@ extern int machine_at_r418_init(const machine_t *);
extern int machine_at_ls486e_init(const machine_t *);
extern int machine_at_4dps_init(const machine_t *);
extern int machine_at_4sa2_init(const machine_t *);
extern int machine_at_m4li_init(const machine_t *);
extern int machine_at_alfredo_init(const machine_t *);
extern int machine_at_486sp3g_init(const machine_t *);
extern int machine_at_486ap4_init(const machine_t *);
@@ -353,6 +354,10 @@ extern int machine_at_excalibur_init(const machine_t *);
extern int machine_at_batman_init(const machine_t *);
extern int machine_at_ambradp60_init(const machine_t *);
#if defined(DEV_BRANCH) && defined(USE_DELLS4)
extern int machine_at_dellxp60_init(const machine_t *);
extern int machine_at_opti560l_init(const machine_t *);
#endif
extern int machine_at_valuepointp60_init(const machine_t *);
extern int machine_at_p5mp3_init(const machine_t *);
extern int machine_at_pb520r_init(const machine_t *);
@@ -478,6 +483,7 @@ extern int machine_at_awo671r_init(const machine_t *);
extern int machine_at_63a_init(const machine_t *);
extern int machine_at_s370sba_init(const machine_t *);
extern int machine_at_apas3_init(const machine_t *);
extern int machine_at_603tcf_init(const machine_t *);
/* m_at_misc.c */
extern int machine_at_vpc2007_init(const machine_t *);

View File

@@ -122,6 +122,7 @@ extern const device_t i440gx_agp_device;
extern const device_t via_vp3_agp_device;
extern const device_t via_mvp3_agp_device;
extern const device_t via_apro_agp_device;
extern const device_t via_vt8601_agp_device;
#endif

View File

@@ -37,10 +37,10 @@
/* SB 2.0 CD version */
typedef struct sb_ct1335_mixer_t
{
int32_t master;
int32_t voice;
int32_t fm;
int32_t cd;
double master;
double voice;
double fm;
double cd;
uint8_t index;
uint8_t regs[256];
@@ -48,12 +48,12 @@ typedef struct sb_ct1335_mixer_t
/* SB PRO */
typedef struct sb_ct1345_mixer_t
{
int32_t master_l, master_r;
int32_t voice_l, voice_r;
int32_t fm_l, fm_r;
int32_t cd_l, cd_r;
int32_t line_l, line_r;
int32_t mic;
double master_l, master_r;
double voice_l, voice_r;
double fm_l, fm_r;
double cd_l, cd_r;
double line_l, line_r;
double mic;
/*see sb_ct1745_mixer for values for input selector*/
int32_t input_selector;
@@ -71,13 +71,13 @@ typedef struct sb_ct1345_mixer_t
/* SB16 and AWE32 */
typedef struct sb_ct1745_mixer_t
{
int32_t master_l, master_r;
int32_t voice_l, voice_r;
int32_t fm_l, fm_r;
int32_t cd_l, cd_r;
int32_t line_l, line_r;
int32_t mic;
int32_t speaker;
double master_l, master_r;
double voice_l, voice_r;
double fm_l, fm_r;
double cd_l, cd_r;
double line_l, line_r;
double mic;
double speaker;
int bass_l, bass_r;
int treble_l, treble_r;
@@ -103,8 +103,8 @@ typedef struct sb_ct1745_mixer_t
int32_t input_gain_L;
int32_t input_gain_R;
int32_t output_gain_L;
int32_t output_gain_R;
double output_gain_L;
double output_gain_R;
uint8_t index;
uint8_t regs[256];
@@ -112,7 +112,7 @@ typedef struct sb_ct1745_mixer_t
typedef struct sb_t
{
uint8_t opl_enabled;
uint8_t opl_enabled, mixer_enabled;
opl_t opl, opl2;
sb_dsp_t dsp;
union {
@@ -133,6 +133,7 @@ extern uint8_t sb_ct1345_mixer_read(uint16_t addr, void *p);
extern void sb_ct1345_mixer_reset(sb_t* sb);
extern void sb_get_buffer_sbpro(int32_t *buffer, int len, void *p);
extern void sbpro_filter_cd_audio(int channel, double *buffer, void *p);
extern void sb_close(void *p);
extern void sb_speed_changed(void *p);

View File

@@ -46,7 +46,7 @@ extern int sound_card_current;
extern void sound_add_handler(void (*get_buffer)(int32_t *buffer, \
int len, void *p), void *p);
extern void sound_set_cd_audio_filter(void (*filter)(int channel, \
float *buffer, void *p), void *p);
double *buffer, void *p), void *p);
extern int sound_card_available(int card);
extern char *sound_card_getname(int card);

View File

@@ -629,6 +629,31 @@ machine_at_r418_init(const machine_t *model)
return ret;
}
int
machine_at_m4li_init(const machine_t *model)
{
int ret;
ret = bios_load_linear(L"roms/machines/m4li/M4LI.04S",
0x000e0000, 131072, 0);
if (bios_only || !ret)
return ret;
machine_at_common_init_ex(model, 2);
machine_at_sis_85c496_common_init(model);
device_add(&sis_85c496_device);
pci_register_slot(0x0B, PCI_CARD_NORMAL, 1, 2, 3, 4);
pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 3, 4, 1);
pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2);
pci_register_slot(0x07, PCI_CARD_NORMAL, 4, 1, 2, 3);
device_add(&fdc37c665_device);
device_add(&keyboard_ps2_pci_device);
return ret;
}
int
machine_at_ls486e_init(const machine_t *model)

View File

@@ -276,7 +276,6 @@ machine_at_63a_init(const machine_t *model)
return ret;
}
int
machine_at_apas3_init(const machine_t *model)
{
@@ -307,3 +306,56 @@ machine_at_apas3_init(const machine_t *model)
return ret;
}
int
machine_at_603tcf_init(const machine_t *model)
{
int ret;
ret = bios_load_linear(L"roms/machines/603tcf/603tcfA4.BIN",
0x000c0000, 262144, 0);
if (bios_only || !ret)
return ret;
machine_at_common_init_ex(model, 2);
pci_init(PCI_CONFIG_TYPE_1);
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 0, 0);
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1);
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3);
pci_register_slot(0x01, PCI_CARD_SPECIAL, 1, 2, 3, 4);
device_add(&via_vt8601_device);
device_add(&via_vt82c686b_device);
device_add(&via_vt82c686_sio_device);
device_add(&keyboard_ps2_ami_pci_device);
device_add(&sst_flash_39sf020_device);
spd_register(SPD_TYPE_SDRAM, 0x3, 256);
hwm_values_t machine_hwm = {
{ /* fan speeds */
3000, /* Chassis */
3000, /* CPU */
3000 /* Power */
}, { /* temperatures */
30, /* MB */
30, /* JTPWR */
30 /* CPU */
}, { /* voltages */
2050, /* VCORE (2.05V by default) */
0, /* unused */
3300, /* +3.3V */
RESISTOR_DIVIDER(5000, 11, 16), /* +5V (divider values bruteforced) */
RESISTOR_DIVIDER(12000, 28, 10), /* +12V (28K/10K divider suggested in the W83781D datasheet) */
RESISTOR_DIVIDER(12000, 59, 20), /* -12V (divider values bruteforced) */
RESISTOR_DIVIDER(5000, 1, 2) /* -5V (divider values bruteforced) */
}
};
hwm_set_values(machine_hwm);
device_add(&via_vt82c686_hwm_device);
return ret;
}

View File

@@ -120,6 +120,67 @@ machine_at_batman_init(const machine_t *model)
return ret;
}
#if defined(DEV_BRANCH) && defined(USE_DELLS4)
int
machine_at_dellxp60_init(const machine_t *model)
{
int ret;
ret = bios_load_linear(L"roms/machines/dellxp60/XP60-A08.ROM",
0x000e0000, 131072, 0);
if (bios_only || !ret)
return ret;
machine_at_common_init(model);
device_add(&ide_pci_2ch_device);
pci_init(PCI_CONFIG_TYPE_2 | PCI_NO_IRQ_STEERING);
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
pci_register_slot(0x01, PCI_CARD_SPECIAL, 0, 0, 0, 0);
pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 2, 1, 4);
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4);
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4);
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
device_add(&i430lx_device);
device_add(&keyboard_ps2_intel_ami_pci_device);
device_add(&sio_device);
device_add(&fdc37c665_device);
device_add(&intel_flash_bxt_ami_device);
return ret;
}
int
machine_at_opti560l_init(const machine_t *model)
{
int ret;
ret = bios_load_linear(L"roms/machines/opti560l/560L_A06.ROM",
0x000e0000, 131072, 0);
if (bios_only || !ret)
return ret;
machine_at_common_init(model);
device_add(&ide_pci_2ch_device);
pci_init(PCI_CONFIG_TYPE_2 | PCI_NO_IRQ_STEERING);
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
pci_register_slot(0x01, PCI_CARD_SPECIAL, 0, 0, 0, 0);
pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 2, 1, 4);
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4);
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4);
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
device_add(&i430lx_device);
device_add(&keyboard_ps2_intel_ami_pci_device);
device_add(&sio_device);
device_add(&fdc37c665_device);
device_add(&intel_flash_bxt_ami_device);
return ret;
}
#endif
int
machine_at_ambradp60_init(const machine_t *model)

View File

@@ -774,14 +774,15 @@ machine_at_gw2kte_init(const machine_t *model)
pci_init(PCI_CONFIG_TYPE_1);
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
pci_register_slot(0x08, PCI_CARD_ONBOARD, 4, 0, 0, 0);
pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4);
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1);
pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2);
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4);
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1);
pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2);
pci_register_slot(0x10, PCI_CARD_NORMAL, 3, 4, 1, 2);
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4);
device_add(&i430vx_device);
device_add(&piix3_device);
device_add(&keyboard_ps2_ami_pci_device);
device_add(&pc87306_device);
device_add(&fdc37c932fr_device);
device_add(&intel_flash_bxt_ami_device);
return ret;

View File

@@ -244,6 +244,7 @@ const machine_t machines[] = {
{ "[SiS 496] Lucky Star LS-486E", "ls486e", MACHINE_TYPE_486, {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_IDE_DUAL, 1, 128, 1, 255, machine_at_ls486e_init, NULL },
{ "[SiS 496] Rise Computer R418", "r418", MACHINE_TYPE_486, {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_IDE_DUAL, 1, 255, 1, 255, machine_at_r418_init, NULL },
{ "[SiS 496] Soyo 4SA2", "4sa2", MACHINE_TYPE_486, {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_IDE_DUAL, 1, 255, 1, 255, machine_at_4sa2_init, NULL },
{ "[SiS 496] Micronics M4Li", "m4li", MACHINE_TYPE_486, {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 1, 128, 1, 127, machine_at_m4li_init, NULL },
{ "[SiS 496] Zida Tomato 4DP", "4dps", MACHINE_TYPE_486, {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_IDE_DUAL, 1, 255, 1, 255, machine_at_4dps_init, NULL },
#if defined(DEV_BRANCH) && defined(NO_SIO)
{ "[VIA VT82C496G] FIC VIP-IO2", "486vipio2", MACHINE_TYPE_486, {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, MACHINE_PCIV | MACHINE_IDE_DUAL, 1, 128, 1, 255, machine_at_486vipio2_init, NULL },
@@ -265,7 +266,11 @@ const machine_t machines[] = {
/* 430LX */
{ "[i430LX] IBM Ambra DP60 PCI", "ambradp60", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2, 128, 2, 127, machine_at_ambradp60_init, NULL },
{ "[i430LX] IBM PS/ValuePoint P60", "valuepointp60", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2, 128, 2, 127, machine_at_valuepointp60_init, NULL },
{ "[i430LX] Intel Premiere/PCI", "revenge", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2, 128, 2, 127, machine_at_batman_init, NULL },
#if defined(DEV_BRANCH) && defined(USE_DELLS4)
{ "[i430LX] Dell Dimension XPS P60", "dellxp60", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2, 128, 2, 127, machine_at_dellxp60_init, NULL },
{ "[i430LX] Dell OptiPlex 560/L", "opti560l", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2, 128, 2, 127, machine_at_opti560l_init, NULL },
#endif
{ "[i430LX] Intel Premiere/PCI", "revenge", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2, 128, 2, 127, machine_at_batman_init, NULL },
{ "[i430LX] ASUS P/I-P5MP3", "p5mp3", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE, 2, 192, 2, 127, machine_at_p5mp3_init, NULL },
{ "[i430LX] Micro Star 586MC1", "586mc1", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 2, 128, 2, 127, machine_at_586mc1_init, NULL },
{ "[i430LX] Packard Bell PB520R", "pb520r", MACHINE_TYPE_SOCKET4, {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 8, 136, 2, 127, machine_at_pb520r_init, at_pb520r_get_device },
@@ -399,6 +404,7 @@ const machine_t machines[] = {
/* VIA Apollo Pro */
{ "[VIA Apollo Pro] PC Partner APAS3", "apas3", MACHINE_TYPE_SOCKET370, {{"Intel", cpus_Celeron}, {"VIA", cpus_Cyrix3}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8, 768, 8, 255, machine_at_apas3_init, NULL },
{ "[VIA Apollo ProMedia] Jetway 603TCF", "603tcf", MACHINE_TYPE_SOCKET370, {{"Intel", cpus_Celeron}, {"VIA", cpus_Cyrix3}, {"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8, 512, 8, 255, machine_at_603tcf_init, NULL },
/* Miscellaneous/Fake/Hypervisor machines */
{ "[i440BX] Microsoft Virtual PC 2007", "vpc2007", MACHINE_TYPE_MISC, {{"Intel", cpus_PentiumIID}, {"Intel/PGA370", cpus_Celeron},{"", NULL}, {"", NULL}, {"", NULL}}, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8, 1024, 8, 255, machine_at_vpc2007_init, NULL },

View File

@@ -2223,7 +2223,7 @@ pcnet_bcr_readw(nic_t *dev, uint16_t rap)
val |= (val & 0x017f & dev->u32Lnkst) ? 0x8000 : 0;
break;
case BCR_MIIADDR:
case BCR_MIIMDR:
if ((dev->board == DEV_AM79C973) && (((dev->aBCR[BCR_MIIADDR] >> 5) & 0x1f) == 0)) {
uint16_t miiaddr = dev->aBCR[BCR_MIIADDR] & 0x1f;
val = pcnet_mii_readw(dev, miiaddr);

View File

@@ -392,6 +392,9 @@ poll_thread(void *arg)
slirp_log("SLiRP: polling stopped.\n");
thread_set_event(slirp->poll_state);
/* Destroy event here to avoid a crash. */
slirp_log("SLiRP: thread ended\n");
thread_destroy_event(slirp->poll_state);
/* Free here instead of immediately freeing the global slirp on the main
thread to avoid a race condition. */
slirp_cleanup(slirp->slirp);
@@ -451,8 +454,6 @@ net_slirp_close(void)
/* Wait for the thread to finish. */
slirp_log("SLiRP: waiting for thread to end...\n");
thread_wait_event(slirp->poll_state, -1);
slirp_log("SLiRP: thread ended\n");
thread_destroy_event(slirp->poll_state);
}
/* Shutdown work is done by the thread on its local copy of slirp. */

View File

@@ -515,21 +515,18 @@ timer_intr(void *priv)
timer_advance_u64(&local->rtc_timer, RTCCONST);
if (local->state == 1) {
local->count--;
if (local->count == 0)
if (--local->count == 0) {
timer_load_count(nvr);
else
return;
} else
return;
nvr->regs[RTC_REGC] |= REGC_PF;
if (nvr->regs[RTC_REGB] & REGB_PIE) {
nvr->regs[RTC_REGC] |= REGC_IRQF;
nvr->regs[RTC_REGC] |= REGC_PF;
if (nvr->regs[RTC_REGB] & REGB_PIE) {
nvr->regs[RTC_REGC] |= REGC_IRQF;
/* Generate an interrupt. */
if (nvr->irq != -1)
picint(1 << nvr->irq);
/* Generate an interrupt. */
if (nvr->irq != -1)
picint(1 << nvr->irq);
}
}
}
}

View File

@@ -139,7 +139,7 @@ fdc37c93x_fdc_handler(fdc37c93x_t *dev)
fdc_remove(dev->fdc);
if (global_enable && local_enable) {
ld_port = make_port(dev, 0);
ld_port = make_port(dev, 0) & 0xFFF8;
if ((ld_port >= 0x0100) && (ld_port <= 0x0FF8))
fdc_set_base(dev->fdc, ld_port);
}
@@ -159,7 +159,7 @@ fdc37c93x_lpt_handler(fdc37c93x_t *dev)
lpt1_remove();
if (global_enable && local_enable) {
ld_port = make_port(dev, 3);
ld_port = make_port(dev, 3) & 0xFFFC;
if ((ld_port >= 0x0100) && (ld_port <= 0x0FFC))
lpt1_init(ld_port);
}
@@ -177,7 +177,7 @@ fdc37c93x_serial_handler(fdc37c93x_t *dev, int uart)
serial_remove(dev->uart[uart]);
if (global_enable && local_enable) {
ld_port = make_port(dev, uart_no);
ld_port = make_port(dev, uart_no) & 0xFFF8;
if ((ld_port >= 0x0100) && (ld_port <= 0x0FF8))
serial_setup(dev->uart[uart], ld_port, dev->ld_regs[uart_no][0x70]);
}
@@ -203,7 +203,7 @@ fdc37c93x_nvr_sec_handler(fdc37c93x_t *dev)
nvr_at_sec_handler(0, dev->nvr_sec_base, dev->nvr);
if (local_enable) {
dev->nvr_sec_base = ld_port = make_port_sec(dev, 6);
dev->nvr_sec_base = ld_port = make_port_sec(dev, 6) & 0xFFFE;
if ((ld_port >= 0x0100) && (ld_port <= 0x0FFE))
nvr_at_sec_handler(1, ld_port, dev->nvr);
}
@@ -335,14 +335,14 @@ fdc37c93x_acpi_handler(fdc37c93x_t *dev)
acpi_update_io_mapping(dev->acpi, 0x0000, local_enable);
if (local_enable) {
ld_port = make_port(dev, 0x0a);
ld_port = make_port(dev, 0x0a) & 0xFFF0;
if ((ld_port >= 0x0100) && (ld_port <= 0x0FF0))
acpi_update_io_mapping(dev->acpi, ld_port, local_enable);
}
acpi_update_aux_io_mapping(dev->acpi, 0x0000, local_enable);
if (local_enable) {
ld_port = make_port_sec(dev, 0x0a);
ld_port = make_port_sec(dev, 0x0a) & 0xFFF8;
if ((ld_port >= 0x0100) && (ld_port <= 0x0FF8))
acpi_update_aux_io_mapping(dev->acpi, ld_port, local_enable);
}
@@ -789,7 +789,7 @@ static const device_t access_bus_device = {
0,
0x03,
access_bus_init, access_bus_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
NULL
};

View File

@@ -221,14 +221,14 @@ static void ad1848_poll(void *p)
}
}
static void ad1848_filter_cd_audio(int channel, float *buffer, void *p)
static void ad1848_filter_cd_audio(int channel, double *buffer, void *p)
{
ad1848_t *ad1848 = (ad1848_t *)p;
int32_t c;
uint32_t volume = channel ? ad1848->cd_vol_r : ad1848->cd_vol_l;
c = (((int32_t) *buffer) * volume) >> 16;
*buffer = (float) c;
*buffer = (double) c;
}
void ad1848_init(ad1848_t *ad1848, int type)

View File

@@ -1274,7 +1274,7 @@ static void es1371_get_buffer(int32_t *buffer, int len, void *p)
es1371->pos = 0;
}
static void es1371_filter_cd_audio(int channel, float *buffer, void *p)
static void es1371_filter_cd_audio(int channel, double *buffer, void *p)
{
es1371_t *es1371 = (es1371_t *)p;
int32_t c;
@@ -1284,7 +1284,7 @@ static void es1371_filter_cd_audio(int channel, float *buffer, void *p)
c = (((int32_t) *buffer) * cd) >> 15;
c = (c * master) >> 15;
*buffer = (float) c;
*buffer = (double) c;
}
static inline double sinc(double x)

View File

@@ -1172,6 +1172,7 @@ azt_init(const device_t *info)
azt2316a_create_config_word(azt2316a);
sound_add_handler(azt2316a_get_buffer, azt2316a);
sound_set_cd_audio_filter(sbpro_filter_cd_audio, azt2316a->sb);
if (azt2316a->cur_mpu401_enabled) {
azt2316a->mpu = (mpu_t *) malloc(sizeof(mpu_t));

File diff suppressed because it is too large Load Diff

View File

@@ -117,7 +117,7 @@ uint8_t adjustMap2[24] = {
252, 0, 252, 0
};
float low_fir_sb16_coef[SB16_NCoef];
double low_fir_sb16_coef[2][SB16_NCoef];
#ifdef ENABLE_SB_DSP_LOG
@@ -147,13 +147,13 @@ sinc(double x)
}
static void
recalc_sb16_filter(int playback_freq)
recalc_sb16_filter(int c, int playback_freq)
{
/* Cutoff frequency = playback / 2 */
float fC = ((float)playback_freq / 2.0) / 48000.0;
float gain;
int n;
double w, h;
double fC = ((double) playback_freq) / 96000.0;
double gain;
for (n = 0; n < SB16_NCoef; n++) {
/* Blackman window */
@@ -162,18 +162,18 @@ recalc_sb16_filter(int playback_freq)
h = sinc(2.0 * fC * ((double)n - ((double)(SB16_NCoef-1) / 2.0)));
/* Create windowed-sinc filter */
low_fir_sb16_coef[n] = w * h;
low_fir_sb16_coef[c][n] = w * h;
}
low_fir_sb16_coef[(SB16_NCoef - 1) / 2] = 1.0;
low_fir_sb16_coef[c][(SB16_NCoef - 1) / 2] = 1.0;
gain = 0.0;
for (n = 0; n < SB16_NCoef; n++)
gain += low_fir_sb16_coef[n];
gain += low_fir_sb16_coef[c][n];
/* Normalise filter, to produce unity gain */
for (n = 0; n < SB16_NCoef; n++)
low_fir_sb16_coef[n] /= gain;
low_fir_sb16_coef[c][n] /= gain;
}
@@ -555,7 +555,7 @@ sb_exec_command(sb_dsp_t *dsp)
temp = 1000000 / temp;
sb_dsp_log("Sample rate - %ihz (%i)\n",temp, dsp->sblatcho);
if ((dsp->sb_freq != temp) && (dsp->sb_type >= SB16))
recalc_sb16_filter(temp);
recalc_sb16_filter(0, temp);
dsp->sb_freq = temp;
break;
case 0x41: /* Set output sampling rate */
@@ -569,7 +569,7 @@ sb_exec_command(sb_dsp_t *dsp)
dsp->sblatchi = dsp->sblatcho;
dsp->sb_timei = dsp->sb_timeo;
if (dsp->sb_freq != temp && dsp->sb_type >= SB16)
recalc_sb16_filter(dsp->sb_freq);
recalc_sb16_filter(0, dsp->sb_freq);
}
break;
case 0x48: /* Set DSP block transfer size */
@@ -1046,7 +1046,8 @@ sb_dsp_init(sb_dsp_t *dsp, int type, int subtype, void *parent)
/* Initialise SB16 filter to same cutoff as 8-bit SBs (3.2 kHz). This will be recalculated when
a set frequency command is sent. */
recalc_sb16_filter(3200*2);
recalc_sb16_filter(0, 3200*2);
recalc_sb16_filter(1, 44100);
}

View File

@@ -77,7 +77,7 @@ static int cd_buf_update = CD_BUFLEN / SOUNDBUFLEN;
static volatile int cdaudioon = 0;
static int cd_thread_enable = 0;
static void (*filter_cd_audio)(int channel, float *buffer, void *p) = NULL;
static void (*filter_cd_audio)(int channel, double *buffer, void *p) = NULL;
static void *filter_cd_audio_p = NULL;
@@ -215,8 +215,8 @@ static void
sound_cd_thread(void *param)
{
int c, r, i, channel_select[2];
float audio_vol_l, audio_vol_r;
float cd_buffer_temp[2] = {0.0, 0.0};
double audio_vol_l, audio_vol_r;
double cd_buffer_temp[2] = {0.0, 0.0};
thread_set_event(sound_cd_start_event);
@@ -274,18 +274,18 @@ sound_cd_thread(void *param)
if ((audio_vol_l != 0.0) && (channel_select[0] != 0)) {
if (channel_select[0] & 1)
cd_buffer_temp[0] += ((float) cd_buffer[i][c]); /* Channel 0 => Port 0 */
cd_buffer_temp[0] += ((double) cd_buffer[i][c]); /* Channel 0 => Port 0 */
if (channel_select[0] & 2)
cd_buffer_temp[0] += ((float) cd_buffer[i][c + 1]); /* Channel 1 => Port 0 */
cd_buffer_temp[0] += ((double) cd_buffer[i][c + 1]); /* Channel 1 => Port 0 */
cd_buffer_temp[0] *= audio_vol_l; /* Multiply Port 0 by Port 0 volume */
}
if ((audio_vol_r != 0.0) && (channel_select[1] != 0)) {
if (channel_select[1] & 1)
cd_buffer_temp[1] += ((float) cd_buffer[i][c]); /* Channel 0 => Port 1 */
cd_buffer_temp[1] += ((double) cd_buffer[i][c]); /* Channel 0 => Port 1 */
if (channel_select[1] & 2)
cd_buffer_temp[1] += ((float) cd_buffer[i][c + 1]); /* Channel 1 => Port 1 */
cd_buffer_temp[1] += ((double) cd_buffer[i][c + 1]); /* Channel 1 => Port 1 */
cd_buffer_temp[1] *= audio_vol_r; /* Multiply Port 1 by Port 1 volume */
}
@@ -297,8 +297,8 @@ sound_cd_thread(void *param)
}
if (sound_is_float) {
cd_out_buffer[c] += (cd_buffer_temp[0] / 32768.0);
cd_out_buffer[c+1] += (cd_buffer_temp[1] / 32768.0);
cd_out_buffer[c] += (float) (cd_buffer_temp[0] / 32768.0);
cd_out_buffer[c+1] += (float) (cd_buffer_temp[1] / 32768.0);
} else {
if (cd_buffer_temp[0] > 32767)
cd_buffer_temp[0] = 32767;
@@ -309,8 +309,8 @@ sound_cd_thread(void *param)
if (cd_buffer_temp[1] < -32768)
cd_buffer_temp[1] = -32768;
cd_out_buffer_int16[c] += cd_buffer_temp[0];
cd_out_buffer_int16[c+1] += cd_buffer_temp[1];
cd_out_buffer_int16[c] += (int16_t) cd_buffer_temp[0];
cd_out_buffer_int16[c+1] += (int16_t) cd_buffer_temp[1];
}
}
}
@@ -384,7 +384,7 @@ sound_add_handler(void (*get_buffer)(int32_t *buffer, int len, void *p), void *p
void
sound_set_cd_audio_filter(void (*filter)(int channel, float *buffer, void *p), void *p)
sound_set_cd_audio_filter(void (*filter)(int channel, double *buffer, void *p), void *p)
{
if ((filter_cd_audio == NULL) || (filter == NULL)) {
filter_cd_audio = filter;

View File

@@ -912,10 +912,8 @@ svga_init(const device_t *info, svga_t *svga, void *p, int memsize,
svga->overlay_draw = overlay_draw;
svga->hwcursor.xsize = svga->hwcursor.ysize = 32;
svga->hwcursor.yoff = 32;
svga->dac_hwcursor.xsize = svga->dac_hwcursor.ysize = 32;
svga->dac_hwcursor.yoff = 32;
svga->translate_address = NULL;
svga->ksc5601_english_font_type = 0;

View File

@@ -117,6 +117,9 @@ ifeq ($(DEV_BUILD), y)
ifndef USE_VECT486VL
USE_VECT486VL := y
endif
ifndef USE_DELLS4
USE_DELLS4 := y
endif
else
ifndef DEBUG
DEBUG := n
@@ -208,6 +211,9 @@ else
ifndef USE_VECT486VL
USE_VECT486VL := n
endif
ifndef USE_DELLS4
USE_DELLS4 := n
endif
endif
# Defaults for several build options (possibly defined in a chained file.)
@@ -630,6 +636,10 @@ ifeq ($(USE_VECT486VL), y)
OPTS += -DUSE_VECT486VL
endif
ifeq ($(USE_DELLS4), y)
OPTS += -DUSE_DELLS4
endif
endif