VIA Apollo VPX: Fix SMRAM handling.

This commit is contained in:
OBattler
2024-06-01 02:00:22 +02:00
parent 3c907287e1
commit ab137e999e

View File

@@ -444,7 +444,7 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv)
apollo_smram_map(dev, 0, 0x000a0000, 0x00020000, 0);
break;
}
else
else if (dev->id == VIA_595)
switch (val & 0x03) {
case 0x00:
apollo_smram_map(dev, 1, 0x000a0000, 0x00020000, 0);
@@ -468,6 +468,12 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv)
default:
break;
}
else {
smram_enable(dev->smram, 0x000a0000, 0x000a0000, 0x00020000,
(dev->pci_conf[0x6d] & 0x10) && (dev->pci_conf[0x63] & 0x01),
dev->pci_conf[0x63] & 0x01);
flushmmucache();
}
break;
case 0x65:
if (dev->id == VIA_585)
@@ -532,6 +538,13 @@ via_apollo_host_bridge_write(int func, int addr, uint8_t val, void *priv)
dev->pci_conf[0x6d] = (dev->pci_conf[0x6d] & ~0x7f) | (val & 0x7f);
else
dev->pci_conf[0x6d] = val;
if (dev->id == VIA_585) {
smram_disable_all();
smram_enable(dev->smram, 0x000a0000, 0x000a0000, 0x00020000,
(dev->pci_conf[0x6d] & 0x10) && (dev->pci_conf[0x63] & 0x01),
dev->pci_conf[0x63] & 0x01);
flushmmucache();
}
break;
case 0x6e:
if ((dev->id == VIA_595) || (dev->id == VIA_694))