summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author yz70s <yz70s@users.noreply.github.com>2019-06-12 22:30:15 +0200
committer yz70s <yz70s@users.noreply.github.com>2019-06-12 22:45:15 +0200
commit4d02f9f0924b237fa78804da9fd5d7fd5c86aaf0 (patch)
tree265f05bc697d7bd9f5990baa27996f6fbe0e1f8c
parent3c955e03eaff0be4ecdfb07f8afac4e567650a8f (diff)
pci.cpp: correct bug #5213 (nw)
-rw-r--r--src/devices/machine/pci.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/devices/machine/pci.cpp b/src/devices/machine/pci.cpp
index 71e5a5e3d77..7148c37ee81 100644
--- a/src/devices/machine/pci.cpp
+++ b/src/devices/machine/pci.cpp
@@ -189,9 +189,13 @@ READ16_MEMBER(pci_device::command_r)
WRITE16_MEMBER(pci_device::command_w)
{
+ uint16_t old = command;
+
mem_mask &= command_mask;
COMBINE_DATA(&command);
logerror("command = %04x\n", command);
+ if ((old ^ command) & 3)
+ remap_cb();
}
READ16_MEMBER(pci_device::status_r)
@@ -300,8 +304,15 @@ void pci_device::map_device(uint64_t memory_window_start, uint64_t memory_window
{
for(int i=0; i<bank_count; i++) {
bank_info &bi = bank_infos[i];
- if(uint32_t(bi.adr) == 0xffffffff)
+ if(uint32_t(bi.adr) >= 0xfffffffc)
continue;
+ if (bi.flags & M_IO) {
+ if (~command & 1)
+ continue;
+ } else {
+ if (~command & 2)
+ continue;
+ }
if(!bi.size || (bi.flags & M_DISABLED))
continue;
@@ -361,6 +372,7 @@ void pci_device::skip_map_regs(int count)
void pci_device::add_map(uint64_t size, int flags, const address_map_constructor &map, device_t *relative_to)
{
assert(bank_count < 6);
+ assert((size & 3) == 0);
int bid = bank_count++;
bank_infos[bid].map = map;
bank_infos[bid].device = relative_to ? relative_to : this;