WARNING: CONFIGS MIGHT PARTIALLY BREAK WHERE DEVICE NAMES HAVE CHANGED.
Changes to device_t struct to accomodate the upcoming PCI IRQ arbitration rewrite; Added device.c/h API to obtain name from the device_t struct; Significant changes to win/win_settings.c to clean up the code a bit and fix bugs; Ported all the CPU and AudioPCI commits from PCem; Added an API call to allow ACPI soft power off to gracefully stop the emulator; Removed the Siemens PCD-2L from the Dev branch because it now works; Removed the Socket 5 HP Vectra from the Dev branch because it now works; Fixed the Compaq Presario and the Micronics Spitfire; Give the IBM PC330 its own list of 486 CPU so it can have DX2's with CPUID 0x470; SMM fixes; Rewrote the SYSENTER, SYSEXIT, SYSCALL, and SYSRET instructions; Changed IDE reset period to match the specification, fixes #929; The keyboard input and output ports are now forced in front of the queue when read, fixes a number of bugs, including the AMI Apollo hanging on soft reset; Added the Intel AN430TX but Dev branched because it does not work; The network code no longer drops packets if the emulated network card has failed to receive them (eg. when the buffer is full); Changes to PCI card adding and renamed some PCI slot types, also added proper AGP bridge slot types; USB UHCI emulation is no longer a stub (still doesn't fully work, but at least Windows XP chk with Debug no longer ASSERT's on it); Fixed NVR on the the SMC FDC37C932QF and APM variants; A number of fixes to Intel 4x0 chipsets, including fixing every register of the 440LX and 440EX; Some ACPI changes.
This commit is contained in:
@@ -153,7 +153,7 @@ const int32_t codec_attn[]= {
|
||||
};
|
||||
|
||||
static void es1371_fetch(es1371_t *es1371, int dac_nr);
|
||||
static void update_legacy(es1371_t *es1371);
|
||||
static void update_legacy(es1371_t *es1371, uint32_t old_legacy_ctrl);
|
||||
|
||||
#ifdef ENABLE_AUDIOPCI_LOG
|
||||
int audiopci_do_log = ENABLE_AUDIOPCI_LOG;
|
||||
@@ -425,6 +425,7 @@ static uint32_t es1371_inl(uint16_t port, void *p)
|
||||
static void es1371_outb(uint16_t port, uint8_t val, void *p)
|
||||
{
|
||||
es1371_t *es1371 = (es1371_t *)p;
|
||||
uint32_t old_legacy_ctrl;
|
||||
|
||||
audiopci_log("es1371_outb: port=%04x val=%02x\n", port, val);
|
||||
switch (port & 0x3f)
|
||||
@@ -474,14 +475,16 @@ static void es1371_outb(uint16_t port, uint8_t val, void *p)
|
||||
nmi = 0;
|
||||
break;
|
||||
case 0x1a:
|
||||
old_legacy_ctrl = es1371->legacy_ctrl;
|
||||
es1371->legacy_ctrl = (es1371->legacy_ctrl & 0xff00ffff) | (val << 16);
|
||||
update_legacy(es1371);
|
||||
update_legacy(es1371, old_legacy_ctrl);
|
||||
break;
|
||||
case 0x1b:
|
||||
old_legacy_ctrl = es1371->legacy_ctrl;
|
||||
es1371->legacy_ctrl = (es1371->legacy_ctrl & 0x00ffffff) | (val << 24);
|
||||
es1371_update_irqs(es1371);
|
||||
// output = 3;
|
||||
update_legacy(es1371);
|
||||
update_legacy(es1371, old_legacy_ctrl);
|
||||
break;
|
||||
|
||||
case 0x20:
|
||||
@@ -818,63 +821,81 @@ static uint8_t capture_read_slave_dma(uint16_t port, void *p)
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
static void update_legacy(es1371_t *es1371)
|
||||
static void update_legacy(es1371_t *es1371, uint32_t old_legacy_ctrl)
|
||||
{
|
||||
io_removehandler(0x0320, 0x0008, capture_read_sscape,NULL,NULL, capture_write_sscape,NULL,NULL, es1371);
|
||||
io_removehandler(0x0330, 0x0008, capture_read_sscape,NULL,NULL, capture_write_sscape,NULL,NULL, es1371);
|
||||
io_removehandler(0x0340, 0x0008, capture_read_sscape,NULL,NULL, capture_write_sscape,NULL,NULL, es1371);
|
||||
io_removehandler(0x0350, 0x0008, capture_read_sscape,NULL,NULL, capture_write_sscape,NULL,NULL, es1371);
|
||||
if (old_legacy_ctrl & LEGACY_CAPTURE_SSCAPE)
|
||||
{
|
||||
switch ((old_legacy_ctrl >> LEGACY_SSCAPE_ADDR_SHIFT) & 3)
|
||||
{
|
||||
case 0: io_removehandler(0x0320, 0x0008, capture_read_sscape,NULL,NULL, capture_write_sscape,NULL,NULL, es1371); break;
|
||||
case 1: io_removehandler(0x0330, 0x0008, capture_read_sscape,NULL,NULL, capture_write_sscape,NULL,NULL, es1371); break;
|
||||
case 2: io_removehandler(0x0340, 0x0008, capture_read_sscape,NULL,NULL, capture_write_sscape,NULL,NULL, es1371); break;
|
||||
case 3: io_removehandler(0x0350, 0x0008, capture_read_sscape,NULL,NULL, capture_write_sscape,NULL,NULL, es1371); break;
|
||||
}
|
||||
}
|
||||
if (old_legacy_ctrl & LEGACY_CAPTURE_CODEC)
|
||||
{
|
||||
switch ((old_legacy_ctrl >> LEGACY_CODEC_ADDR_SHIFT) & 3)
|
||||
{
|
||||
case 0: io_removehandler(0x5300, 0x0080, capture_read_codec,NULL,NULL, capture_write_codec,NULL,NULL, es1371); break;
|
||||
case 2: io_removehandler(0xe800, 0x0080, capture_read_codec,NULL,NULL, capture_write_codec,NULL,NULL, es1371); break;
|
||||
case 3: io_removehandler(0xf400, 0x0080, capture_read_codec,NULL,NULL, capture_write_codec,NULL,NULL, es1371); break;
|
||||
}
|
||||
}
|
||||
if (old_legacy_ctrl & LEGACY_CAPTURE_SB)
|
||||
{
|
||||
if (!(old_legacy_ctrl & LEGACY_SB_ADDR))
|
||||
io_removehandler(0x0220, 0x0010, capture_read_sb,NULL,NULL, capture_write_sb,NULL,NULL, es1371);
|
||||
else
|
||||
io_removehandler(0x0240, 0x0010, capture_read_sb,NULL,NULL, capture_write_sb,NULL,NULL, es1371);
|
||||
}
|
||||
if (old_legacy_ctrl & LEGACY_CAPTURE_ADLIB)
|
||||
io_removehandler(0x0388, 0x0004, capture_read_adlib,NULL,NULL, capture_write_adlib,NULL,NULL, es1371);
|
||||
if (old_legacy_ctrl & LEGACY_CAPTURE_MASTER_PIC)
|
||||
io_removehandler(0x0020, 0x0002, capture_read_master_pic,NULL,NULL, capture_write_master_pic,NULL,NULL, es1371);
|
||||
if (old_legacy_ctrl & LEGACY_CAPTURE_MASTER_DMA)
|
||||
io_removehandler(0x0000, 0x0010, capture_read_master_dma,NULL,NULL, capture_write_master_dma,NULL,NULL, es1371);
|
||||
if (old_legacy_ctrl & LEGACY_CAPTURE_SLAVE_PIC)
|
||||
io_removehandler(0x00a0, 0x0002, capture_read_slave_pic,NULL,NULL, capture_write_slave_pic,NULL,NULL, es1371);
|
||||
if (old_legacy_ctrl & LEGACY_CAPTURE_SLAVE_DMA)
|
||||
io_removehandler(0x00c0, 0x0020, capture_read_slave_dma,NULL,NULL, capture_write_slave_dma,NULL,NULL, es1371);
|
||||
|
||||
io_removehandler(0x5300, 0x0080, capture_read_codec,NULL,NULL, capture_write_codec,NULL,NULL, es1371);
|
||||
io_removehandler(0xe800, 0x0080, capture_read_codec,NULL,NULL, capture_write_codec,NULL,NULL, es1371);
|
||||
io_removehandler(0xf400, 0x0080, capture_read_codec,NULL,NULL, capture_write_codec,NULL,NULL, es1371);
|
||||
|
||||
io_removehandler(0x0220, 0x0010, capture_read_sb,NULL,NULL, capture_write_sb,NULL,NULL, es1371);
|
||||
io_removehandler(0x0240, 0x0010, capture_read_sb,NULL,NULL, capture_write_sb,NULL,NULL, es1371);
|
||||
|
||||
io_removehandler(0x0388, 0x0004, capture_read_adlib,NULL,NULL, capture_write_adlib,NULL,NULL, es1371);
|
||||
|
||||
io_removehandler(0x0020, 0x0002, capture_read_master_pic,NULL,NULL, capture_write_master_pic,NULL,NULL, es1371);
|
||||
io_removehandler(0x0000, 0x0010, capture_read_master_dma,NULL,NULL, capture_write_master_dma,NULL,NULL, es1371);
|
||||
io_removehandler(0x00a0, 0x0002, capture_read_slave_pic,NULL,NULL, capture_write_slave_pic,NULL,NULL, es1371);
|
||||
io_removehandler(0x00c0, 0x0020, capture_read_slave_dma,NULL,NULL, capture_write_slave_dma,NULL,NULL, es1371);
|
||||
|
||||
if (es1371->legacy_ctrl & LEGACY_CAPTURE_SSCAPE)
|
||||
{
|
||||
switch ((es1371->legacy_ctrl >> LEGACY_SSCAPE_ADDR_SHIFT) & 3)
|
||||
{
|
||||
case 0: io_sethandler(0x0320, 0x0008, capture_read_sscape,NULL,NULL, capture_write_sscape,NULL,NULL, es1371); break;
|
||||
case 1: io_sethandler(0x0330, 0x0008, capture_read_sscape,NULL,NULL, capture_write_sscape,NULL,NULL, es1371); break;
|
||||
case 2: io_sethandler(0x0340, 0x0008, capture_read_sscape,NULL,NULL, capture_write_sscape,NULL,NULL, es1371); break;
|
||||
case 3: io_sethandler(0x0350, 0x0008, capture_read_sscape,NULL,NULL, capture_write_sscape,NULL,NULL, es1371); break;
|
||||
}
|
||||
}
|
||||
if (es1371->legacy_ctrl & LEGACY_CAPTURE_CODEC)
|
||||
{
|
||||
switch ((es1371->legacy_ctrl >> LEGACY_CODEC_ADDR_SHIFT) & 3)
|
||||
{
|
||||
case 0: io_sethandler(0x5300, 0x0080, capture_read_codec,NULL,NULL, capture_write_codec,NULL,NULL, es1371); break;
|
||||
case 2: io_sethandler(0xe800, 0x0080, capture_read_codec,NULL,NULL, capture_write_codec,NULL,NULL, es1371); break;
|
||||
case 3: io_sethandler(0xf400, 0x0080, capture_read_codec,NULL,NULL, capture_write_codec,NULL,NULL, es1371); break;
|
||||
}
|
||||
}
|
||||
if (es1371->legacy_ctrl & LEGACY_CAPTURE_SB)
|
||||
{
|
||||
if (!(es1371->legacy_ctrl & LEGACY_SB_ADDR))
|
||||
io_sethandler(0x0220, 0x0010, capture_read_sb,NULL,NULL, capture_write_sb,NULL,NULL, es1371);
|
||||
else
|
||||
io_sethandler(0x0240, 0x0010, capture_read_sb,NULL,NULL, capture_write_sb,NULL,NULL, es1371);
|
||||
}
|
||||
if (es1371->legacy_ctrl & LEGACY_CAPTURE_ADLIB)
|
||||
io_sethandler(0x0388, 0x0004, capture_read_adlib,NULL,NULL, capture_write_adlib,NULL,NULL, es1371);
|
||||
if (es1371->legacy_ctrl & LEGACY_CAPTURE_MASTER_PIC)
|
||||
io_sethandler(0x0020, 0x0002, capture_read_master_pic,NULL,NULL, capture_write_master_pic,NULL,NULL, es1371);
|
||||
if (es1371->legacy_ctrl & LEGACY_CAPTURE_MASTER_DMA)
|
||||
io_sethandler(0x0000, 0x0010, capture_read_master_dma,NULL,NULL, capture_write_master_dma,NULL,NULL, es1371);
|
||||
if (es1371->legacy_ctrl & LEGACY_CAPTURE_SLAVE_PIC)
|
||||
io_sethandler(0x00a0, 0x0002, capture_read_slave_pic,NULL,NULL, capture_write_slave_pic,NULL,NULL, es1371);
|
||||
if (es1371->legacy_ctrl & LEGACY_CAPTURE_SLAVE_DMA)
|
||||
io_sethandler(0x00c0, 0x0020, capture_read_slave_dma,NULL,NULL, capture_write_slave_dma,NULL,NULL, es1371);
|
||||
if (es1371->legacy_ctrl & LEGACY_CAPTURE_SSCAPE)
|
||||
{
|
||||
switch ((es1371->legacy_ctrl >> LEGACY_SSCAPE_ADDR_SHIFT) & 3)
|
||||
{
|
||||
case 0: io_sethandler(0x0320, 0x0008, capture_read_sscape,NULL,NULL, capture_write_sscape,NULL,NULL, es1371); break;
|
||||
case 1: io_sethandler(0x0330, 0x0008, capture_read_sscape,NULL,NULL, capture_write_sscape,NULL,NULL, es1371); break;
|
||||
case 2: io_sethandler(0x0340, 0x0008, capture_read_sscape,NULL,NULL, capture_write_sscape,NULL,NULL, es1371); break;
|
||||
case 3: io_sethandler(0x0350, 0x0008, capture_read_sscape,NULL,NULL, capture_write_sscape,NULL,NULL, es1371); break;
|
||||
}
|
||||
}
|
||||
if (es1371->legacy_ctrl & LEGACY_CAPTURE_CODEC)
|
||||
{
|
||||
switch ((es1371->legacy_ctrl >> LEGACY_CODEC_ADDR_SHIFT) & 3)
|
||||
{
|
||||
case 0: io_sethandler(0x5300, 0x0080, capture_read_codec,NULL,NULL, capture_write_codec,NULL,NULL, es1371); break;
|
||||
case 2: io_sethandler(0xe800, 0x0080, capture_read_codec,NULL,NULL, capture_write_codec,NULL,NULL, es1371); break;
|
||||
case 3: io_sethandler(0xf400, 0x0080, capture_read_codec,NULL,NULL, capture_write_codec,NULL,NULL, es1371); break;
|
||||
}
|
||||
}
|
||||
if (es1371->legacy_ctrl & LEGACY_CAPTURE_SB)
|
||||
{
|
||||
if (!(es1371->legacy_ctrl & LEGACY_SB_ADDR))
|
||||
io_sethandler(0x0220, 0x0010, capture_read_sb,NULL,NULL, capture_write_sb,NULL,NULL, es1371);
|
||||
else
|
||||
io_sethandler(0x0240, 0x0010, capture_read_sb,NULL,NULL, capture_write_sb,NULL,NULL, es1371);
|
||||
}
|
||||
if (es1371->legacy_ctrl & LEGACY_CAPTURE_ADLIB)
|
||||
io_sethandler(0x0388, 0x0004, capture_read_adlib,NULL,NULL, capture_write_adlib,NULL,NULL, es1371);
|
||||
if (es1371->legacy_ctrl & LEGACY_CAPTURE_MASTER_PIC)
|
||||
io_sethandler(0x0020, 0x0002, capture_read_master_pic,NULL,NULL, capture_write_master_pic,NULL,NULL, es1371);
|
||||
if (es1371->legacy_ctrl & LEGACY_CAPTURE_MASTER_DMA)
|
||||
io_sethandler(0x0000, 0x0010, capture_read_master_dma,NULL,NULL, capture_write_master_dma,NULL,NULL, es1371);
|
||||
if (es1371->legacy_ctrl & LEGACY_CAPTURE_SLAVE_PIC)
|
||||
io_sethandler(0x00a0, 0x0002, capture_read_slave_pic,NULL,NULL, capture_write_slave_pic,NULL,NULL, es1371);
|
||||
if (es1371->legacy_ctrl & LEGACY_CAPTURE_SLAVE_DMA)
|
||||
io_sethandler(0x00c0, 0x0020, capture_read_slave_dma,NULL,NULL, capture_write_slave_dma,NULL,NULL, es1371);
|
||||
}
|
||||
|
||||
|
||||
@@ -1406,7 +1427,7 @@ const device_t es1371_device =
|
||||
es1371_init,
|
||||
es1371_close,
|
||||
NULL,
|
||||
NULL,
|
||||
{ NULL },
|
||||
es1371_speed_changed,
|
||||
NULL,
|
||||
NULL
|
||||
@@ -1420,7 +1441,7 @@ const device_t es1371_onboard_device =
|
||||
es1371_init,
|
||||
es1371_close,
|
||||
NULL,
|
||||
NULL,
|
||||
{ NULL },
|
||||
es1371_speed_changed,
|
||||
NULL,
|
||||
NULL
|
||||
|
||||
Reference in New Issue
Block a user