The Windows IOCTL code now correctly gets the allocated length for the CDB for the READ DVD STRUCTURE command, fixes crashes with Windows 98 SE and ME;

Fixed a few I/O handler adding/removing related bugs in the Intel PIIX/PIIX3, UMC UM8699F Super I/O chip, Sound Blaster DSP, and Realtek 8019AS codes;
The code in io.c now uses linked lists, I had to do this to properly fix the I/O handler mess with the Realtek RTL8019AS on the Award 430VX PCI (which was causing an emulator crash at POST).
This commit is contained in:
OBattler
2018-02-02 00:14:17 +01:00
parent 73ee3c5538
commit 6fd6097467
6 changed files with 269 additions and 231 deletions

View File

@@ -10,13 +10,13 @@
* word 0 - base address
* word 1 - bits 1-15 = byte count, bit 31 = end of transfer
*
* Version: @(#)intel_piix.c 1.0.10 2017/12/15
* Version: @(#)intel_piix.c 1.0.11 2018/02/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
* Copyright 2008-2018 Sarah Walker.
* Copyright 2016-2018 Miran Grca.
*/
#include <stdio.h>
#include <stdint.h>
@@ -104,11 +104,10 @@ void piix_write(int func, int addr, uint8_t val, void *priv)
if (addr == 4 || (addr & ~3) == 0x20) /*Bus master base address*/
{
uint16_t base = (card_piix_ide[0x20] & 0xf0) | (card_piix_ide[0x21] << 8);
io_removehandler(old_base, 0x10, piix_bus_master_read, NULL, NULL, piix_bus_master_write, NULL, NULL, NULL);
if (card_piix_ide[0x04] & 1)
{
if (old_base)
io_removehandler(old_base, 0x10, piix_bus_master_read, NULL, NULL, piix_bus_master_write, NULL, NULL, NULL);
if ((card_piix_ide[0x04] & 1) && base)
io_sethandler(base, 0x10, piix_bus_master_read, NULL, NULL, piix_bus_master_write, NULL, NULL, NULL);
}
}
}
else
@@ -638,8 +637,17 @@ void piix_bus_master_set_irq(int channel)
}
static void piix_bus_master_reset(void)
{
uint16_t old_base = (card_piix_ide[0x20] & 0xf0) | (card_piix_ide[0x21] << 8);
if (old_base)
io_removehandler(old_base, 0x10, piix_bus_master_read, NULL, NULL, piix_bus_master_write, NULL, NULL, NULL);
}
void piix_reset(void)
{
piix_bus_master_reset();
memset(card_piix, 0, 256);
card_piix[0x00] = 0x86; card_piix[0x01] = 0x80; /*Intel*/
card_piix[0x02] = 0x2e; card_piix[0x03] = 0x12; /*82371FB (PIIX)*/
@@ -681,6 +689,7 @@ void piix_reset(void)
void piix3_reset(void)
{
piix_bus_master_reset();
memset(card_piix, 0, 256);
card_piix[0x00] = 0x86; card_piix[0x01] = 0x80; /*Intel*/
card_piix[0x02] = 0x00; card_piix[0x03] = 0x70; /*82371SB (PIIX3)*/