diff --git a/src/i430fx.c b/src/i430fx.c index 5b7cf7f..4db750e 100644 --- a/src/i430fx.c +++ b/src/i430fx.c @@ -34,15 +34,33 @@ static void i430fx_map(uint32_t addr, uint32_t size, int state) void i430fx_write(int func, int addr, uint8_t val, void *priv) { if (func) - return; + return; + + if (addr >= 0x10 && addr < 0x4f) + return; switch (addr) { case 0x00: case 0x01: case 0x02: case 0x03: case 0x08: case 0x09: case 0x0a: case 0x0b: - case 0x0e: + case 0x0c: case 0x0e: return; + case 0x04: /*Command register*/ + val &= 0x02; + val |= 0x04; + break; + case 0x05: + val = 0; + break; + + case 0x06: /*Status*/ + val = 0; + break; + case 0x07: + val = 0x02; + break; + case 0x59: /*PAM0*/ if ((card_i430fx[0x59] ^ val) & 0xf0) { diff --git a/src/i430lx.c b/src/i430lx.c index 1f6a874..ebde9bc 100644 --- a/src/i430lx.c +++ b/src/i430lx.c @@ -36,13 +36,31 @@ void i430lx_write(int func, int addr, uint8_t val, void *priv) if (func) return; + if (addr >= 0x10 && addr < 0x4f) + return; + switch (addr) { case 0x00: case 0x01: case 0x02: case 0x03: case 0x08: case 0x09: case 0x0a: case 0x0b: - case 0x0e: + case 0x0c: case 0x0e: return; + case 0x04: /*Command register*/ + val &= 0x42; + val |= 0x04; + break; + case 0x05: + val &= 0x01; + break; + + case 0x06: /*Status*/ + val = 0; + break; + case 0x07: + val = 0x02; + break; + case 0x59: /*PAM0*/ if ((card_i430lx[0x59] ^ val) & 0xf0) { diff --git a/src/i430vx.c b/src/i430vx.c index 5f2cb05..6b1c4bb 100644 --- a/src/i430vx.c +++ b/src/i430vx.c @@ -34,13 +34,32 @@ void i430vx_write(int func, int addr, uint8_t val, void *priv) if (func) return; + if (addr >= 0x10 && addr < 0x4f) + return; + switch (addr) { case 0x00: case 0x01: case 0x02: case 0x03: case 0x08: case 0x09: case 0x0a: case 0x0b: - case 0x0e: + case 0x0c: case 0x0e: return; + case 0x04: /*Command register*/ + val &= 0x02; + val |= 0x04; + break; + case 0x05: + val = 0; + break; + + case 0x06: /*Status*/ + val = 0; + break; + case 0x07: + val &= 0x80; + val |= 0x02; + break; + case 0x59: /*PAM0*/ if ((card_i430vx[0x59] ^ val) & 0xf0) { diff --git a/src/piix.c b/src/piix.c index a62ba82..1c3bc28 100644 --- a/src/piix.c +++ b/src/piix.c @@ -81,6 +81,9 @@ void piix_write(int func, int addr, uint8_t val, void *priv) } else { + if (addr >= 0x0f && addr < 0x4c) + return; + switch (addr) { case 0x00: case 0x01: case 0x02: case 0x03: @@ -343,7 +346,7 @@ void piix_init(int card, int pci_a, int pci_b, int pci_c, int pci_d) card_piix[0x00] = 0x86; card_piix[0x01] = 0x80; /*Intel*/ card_piix[0x02] = 0x2e; card_piix[0x03] = 0x12; /*82371FB (PIIX)*/ card_piix[0x04] = 0x07; card_piix[0x05] = 0x00; - card_piix[0x06] = 0x00; card_piix[0x07] = 0x02; + card_piix[0x06] = 0x80; card_piix[0x07] = 0x02; card_piix[0x08] = 0x00; /*A0 stepping*/ card_piix[0x09] = 0x00; card_piix[0x0a] = 0x01; card_piix[0x0b] = 0x06; card_piix[0x0e] = 0x80; /*Multi-function device*/