From a9f8830b51044465318dfeec19055febc7c71a68 Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Mon, 19 Feb 2024 23:05:08 +0100 Subject: [PATCH] newpci: propose a way to find the busmaster space --- src/devices/machine/gt64xxx.cpp | 3 +-- src/devices/machine/i82439hx.cpp | 3 +-- src/devices/machine/i82439tx.cpp | 3 +-- src/devices/machine/i82875p.cpp | 3 +-- src/devices/machine/mediagx_host.cpp | 3 +-- src/devices/machine/mpc106.cpp | 3 +-- src/devices/machine/mv6436x.cpp | 3 +-- src/devices/machine/pci.cpp | 9 ++++++++- src/devices/machine/pci.h | 20 ++++++++++++++++--- src/devices/machine/sis630_host.cpp | 3 +-- src/devices/machine/sis85c496.cpp | 3 +-- src/devices/machine/vrc4373.cpp | 3 +-- src/devices/machine/vrc5074.cpp | 3 +-- src/mame/apple/bandit.cpp | 3 +-- src/mame/apple/heathrow.cpp | 29 ++++++++++++++-------------- src/mame/apple/heathrow.h | 2 -- src/mame/apple/imacg3.cpp | 1 - src/mame/apple/pippin.cpp | 1 - src/mame/apple/powermacg3.cpp | 1 - src/mame/pc/nforcepc.cpp | 3 +-- src/mame/sega/315-6154.cpp | 25 ++++++++++++------------ src/mame/sega/315-6154.h | 5 ++--- src/mame/sega/naomigd.cpp | 8 ++++---- src/mame/shared/xbox_pci.cpp | 3 +-- 24 files changed, 72 insertions(+), 71 deletions(-) diff --git a/src/devices/machine/gt64xxx.cpp b/src/devices/machine/gt64xxx.cpp index c00f9c63464..3f3ea408022 100644 --- a/src/devices/machine/gt64xxx.cpp +++ b/src/devices/machine/gt64xxx.cpp @@ -195,8 +195,7 @@ void gt64xxx_device::device_start() { pci_host_device::device_start(); m_cpu_space = &m_cpu->space(AS_PCI_CONFIG); - memory_space = &space(AS_PCI_MEM); - io_space = &space(AS_PCI_IO); + set_spaces(&space(AS_PCI_MEM), &space(AS_PCI_IO)); memory_window_start = 0; memory_window_end = 0xffffffff; diff --git a/src/devices/machine/i82439hx.cpp b/src/devices/machine/i82439hx.cpp index 2a8e1a12714..7dc130dbfa6 100644 --- a/src/devices/machine/i82439hx.cpp +++ b/src/devices/machine/i82439hx.cpp @@ -48,8 +48,7 @@ void i82439hx_host_device::set_ram_size(int _ram_size) void i82439hx_host_device::device_start() { pci_host_device::device_start(); - memory_space = &cpu->space(AS_PROGRAM); - io_space = &cpu->space(AS_IO); + set_spaces(&cpu->space(AS_PROGRAM), &cpu->space(AS_IO)); memory_window_start = 0; memory_window_end = 0xffffffff; diff --git a/src/devices/machine/i82439tx.cpp b/src/devices/machine/i82439tx.cpp index f8c1c9a8bb3..9196f8f7f4d 100644 --- a/src/devices/machine/i82439tx.cpp +++ b/src/devices/machine/i82439tx.cpp @@ -37,8 +37,7 @@ void i82439tx_host_device::set_ram_size(int _ram_size) void i82439tx_host_device::device_start() { pci_host_device::device_start(); - memory_space = &cpu->space(AS_PROGRAM); - io_space = &cpu->space(AS_IO); + set_spaces(&cpu->space(AS_PROGRAM), &cpu->space(AS_IO)); memory_window_start = 0; memory_window_end = 0xffffffff; diff --git a/src/devices/machine/i82875p.cpp b/src/devices/machine/i82875p.cpp index 37d95112359..b187bacfa72 100644 --- a/src/devices/machine/i82875p.cpp +++ b/src/devices/machine/i82875p.cpp @@ -62,8 +62,7 @@ uint8_t i82875p_host_device::capptr_r() void i82875p_host_device::device_start() { pci_host_device::device_start(); - memory_space = &cpu->space(AS_PROGRAM); - io_space = &cpu->space(AS_IO); + set_spaces(&cpu->space(AS_PROGRAM), &cpu->space(AS_IO)); memory_window_start = 0; memory_window_end = 0xffffffff; diff --git a/src/devices/machine/mediagx_host.cpp b/src/devices/machine/mediagx_host.cpp index d53967f731b..e0772e7920e 100644 --- a/src/devices/machine/mediagx_host.cpp +++ b/src/devices/machine/mediagx_host.cpp @@ -104,8 +104,7 @@ device_memory_interface::space_config_vector mediagx_host_device::memory_space_c void mediagx_host_device::device_start() { pci_host_device::device_start(); - memory_space = &m_host_cpu->space(AS_PROGRAM); - io_space = &m_host_cpu->space(AS_IO); + set_spaces(&m_host_cpu->space(AS_PROGRAM), &m_host_cpu->space(AS_IO)); memory_window_start = 0; memory_window_end = 0xffffffff; diff --git a/src/devices/machine/mpc106.cpp b/src/devices/machine/mpc106.cpp index f3c1045cfa0..3bc89e6174d 100644 --- a/src/devices/machine/mpc106.cpp +++ b/src/devices/machine/mpc106.cpp @@ -67,8 +67,7 @@ void mpc106_host_device::device_start() { pci_host_device::device_start(); m_cpu_space = &m_cpu->space(AS_PCI_CONFIG); - memory_space = &space(AS_PCI_MEM); - io_space = &space(AS_PCI_IO); + set_spaces(&space(AS_PCI_MEM), &space(AS_PCI_IO)); memory_window_start = 0; memory_window_end = 0xffffffff; diff --git a/src/devices/machine/mv6436x.cpp b/src/devices/machine/mv6436x.cpp index 07057c54a2b..9db05547393 100644 --- a/src/devices/machine/mv6436x.cpp +++ b/src/devices/machine/mv6436x.cpp @@ -1137,8 +1137,7 @@ void mv64361_pci_host_device::device_start() { pci_host_device::device_start(); - memory_space = &space(AS_PCI_MEM); - io_space = &space(AS_PCI_IO); + set_spaces(&space(AS_PCI_MEM), &space(AS_PCI_IO)); memory_window_start = 0; memory_window_end = 0xffffffff; diff --git a/src/devices/machine/pci.cpp b/src/devices/machine/pci.cpp index 5f6553c277a..e4c582e29a8 100644 --- a/src/devices/machine/pci.cpp +++ b/src/devices/machine/pci.cpp @@ -888,6 +888,12 @@ void pci_host_device::io_configuration_access_map(address_map &map) map(0xcfc, 0xcff).rw(FUNC(pci_host_device::config_data_r), FUNC(pci_host_device::config_data_w)); } +void pci_host_device::set_spaces(address_space *memory, address_space *io, address_space *busmaster) +{ + memory_space = memory; + io_space = io ? io : memory; + m_pci_root->set_pci_busmaster_space(busmaster ? busmaster : memory); +} pci_host_device::pci_host_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : pci_bridge_device(mconfig, type, tag, owner, clock) @@ -1012,7 +1018,8 @@ void pci_host_device::root_config_write(uint8_t bus, uint8_t device, uint16_t re pci_root_device::pci_root_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, PCI_ROOT, tag, owner, clock), m_pin_mapper(*this), - m_irq_handler(*this) + m_irq_handler(*this), + m_pci_busmaster_space(nullptr) { } diff --git a/src/devices/machine/pci.h b/src/devices/machine/pci.h index e6acc255802..d95bf58afbf 100644 --- a/src/devices/machine/pci.h +++ b/src/devices/machine/pci.h @@ -133,6 +133,8 @@ class pci_device : public device_t { void set_map_address(int id, uint64_t adr); void set_map_size(int id, uint64_t size); void set_map_flags(int id, int flags); + + inline address_space *get_pci_busmaster_space() const; }; class agp_device : public pci_device { @@ -243,6 +245,8 @@ class pci_host_device : public pci_bridge_device { public: void io_configuration_access_map(address_map &map); + void set_spaces(address_space *memory, address_space *io = nullptr, address_space *busmaster = nullptr); + protected: pci_host_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -264,12 +268,13 @@ class pci_host_device : public pci_bridge_device { void regenerate_mapping(); - address_space *memory_space, *io_space; - uint64_t memory_window_start, memory_window_end, memory_offset; uint64_t io_window_start, io_window_end, io_offset; uint32_t config_address; + +private: + address_space *memory_space, *io_space; }; using pci_pin_mapper = device_delegate; @@ -285,6 +290,10 @@ class pci_root_device : public device_t { void set_pin_mapper(pci_pin_mapper &&mapper) { m_pin_mapper = std::move(mapper); } void set_irq_handler(pci_irq_handler &&handler) { m_irq_handler = std::move(handler); } + address_space *get_pci_busmaster_space() const { return m_pci_busmaster_space; } + + void set_pci_busmaster_space(address_space *space) { m_pci_busmaster_space = space; } + protected: virtual void device_start() override; virtual void device_reset() override; @@ -292,9 +301,14 @@ class pci_root_device : public device_t { private: pci_pin_mapper m_pin_mapper; pci_irq_handler m_irq_handler; - + address_space *m_pci_busmaster_space; }; +address_space *pci_device::get_pci_busmaster_space() const +{ + return m_pci_root->get_pci_busmaster_space(); +} + DECLARE_DEVICE_TYPE(PCI_ROOT, pci_root_device) DECLARE_DEVICE_TYPE(PCI_BRIDGE, pci_bridge_device) diff --git a/src/devices/machine/sis630_host.cpp b/src/devices/machine/sis630_host.cpp index 5088585aa5f..e5c9f897cde 100644 --- a/src/devices/machine/sis630_host.cpp +++ b/src/devices/machine/sis630_host.cpp @@ -53,8 +53,7 @@ void sis630_host_device::device_start() io_window_end = 0xffff; io_offset = 0; - memory_space = &m_host_cpu->space(AS_PROGRAM); - io_space = &m_host_cpu->space(AS_IO); + set_spaces(&m_host_cpu->space(AS_PROGRAM), &m_host_cpu->space(AS_IO)); add_map(8*1024*1024, M_MEM, FUNC(sis630_host_device::memory_map)); m_ram.resize(m_ram_size/4); diff --git a/src/devices/machine/sis85c496.cpp b/src/devices/machine/sis85c496.cpp index f74a1d818c7..45cc3c9ae66 100644 --- a/src/devices/machine/sis85c496.cpp +++ b/src/devices/machine/sis85c496.cpp @@ -172,8 +172,7 @@ void sis85c496_host_device::device_start() { pci_host_device::device_start(); - memory_space = &m_maincpu->space(AS_PROGRAM); - io_space = &m_maincpu->space(AS_IO); + set_spaces(&m_maincpu->space(AS_PROGRAM), &m_maincpu->space(AS_IO)); memory_window_start = 0; memory_window_end = 0xffffffff; diff --git a/src/devices/machine/vrc4373.cpp b/src/devices/machine/vrc4373.cpp index b7e993c8f90..e4105c88ab6 100644 --- a/src/devices/machine/vrc4373.cpp +++ b/src/devices/machine/vrc4373.cpp @@ -116,8 +116,7 @@ void vrc4373_device::device_start() pci_host_device::device_start(); m_cpu_space = &m_cpu->space(AS_PCI_CONFIG); - memory_space = &space(AS_PCI_MEM); - io_space = &space(AS_PCI_IO); + set_spaces(&space(AS_PCI_MEM), &space(AS_PCI_IO)); is_multifunction_device = false; std::fill(std::begin(m_cpu_regs), std::end(m_cpu_regs), 0); diff --git a/src/devices/machine/vrc5074.cpp b/src/devices/machine/vrc5074.cpp index cfaa8a1e8e8..2bddcaa54a9 100644 --- a/src/devices/machine/vrc5074.cpp +++ b/src/devices/machine/vrc5074.cpp @@ -203,8 +203,7 @@ void vrc5074_device::device_start() { pci_host_device::device_start(); m_cpu_space = &m_cpu->space(AS_PROGRAM); - memory_space = &space(AS_DATA); - io_space = &space(AS_IO); + set_spaces(&space(AS_DATA), &space(AS_IO)); memory_window_start = 0; memory_window_end = 0xffffffff; diff --git a/src/mame/apple/bandit.cpp b/src/mame/apple/bandit.cpp index 8250c79771e..c13271b0115 100644 --- a/src/mame/apple/bandit.cpp +++ b/src/mame/apple/bandit.cpp @@ -51,8 +51,7 @@ void bandit_host_device::device_start() { pci_host_device::device_start(); m_cpu_space = &m_cpu->space(AS_PCI_CONFIG); - memory_space = &space(AS_PCI_MEM); - io_space = &space(AS_PCI_IO); + set_spaces(&space(AS_PCI_MEM), &space(AS_PCI_IO)); memory_window_start = 0; memory_window_end = 0xffffffff; diff --git a/src/mame/apple/heathrow.cpp b/src/mame/apple/heathrow.cpp index d63685bcc14..086df680036 100644 --- a/src/mame/apple/heathrow.cpp +++ b/src/mame/apple/heathrow.cpp @@ -171,7 +171,7 @@ void grandcentral_device::device_add_mconfig(machine_config &config) { macio_device::device_add_mconfig(config); - DBDMA_CHANNEL(config, m_dma_scsi1, 0, m_pci_memory); + DBDMA_CHANNEL(config, m_dma_scsi1, 0); m_dma_scsi1->irq_callback().set(FUNC(macio_device::set_irq_line<10>)); } @@ -217,7 +217,6 @@ macio_device::macio_device(const machine_config &mconfig, device_type type, cons m_dma_sccbrx(*this, "dma_sccb_rx"), m_dma_audio_in(*this, "dma_audin"), m_dma_audio_out(*this, "dma_audout"), - m_pci_memory(*this, ":pci:00.0", AS_DATA), m_cur_floppy(nullptr), m_hdsel(0) { @@ -264,16 +263,18 @@ paddington_device::paddington_device(const machine_config &mconfig, const char * void macio_device::common_init() { - m_dma_scsi->set_address_space(m_pci_memory); - m_dma_floppy->set_address_space(m_pci_memory); - m_dma_sccatx->set_address_space(m_pci_memory); - m_dma_sccarx->set_address_space(m_pci_memory); - m_dma_sccbtx->set_address_space(m_pci_memory); - m_dma_sccbrx->set_address_space(m_pci_memory); - m_dma_audio_in->set_address_space(m_pci_memory); - m_dma_audio_out->set_address_space(m_pci_memory); - pci_device::device_start(); + + address_space *bm = get_pci_busmaster_space(); + m_dma_scsi->set_address_space(bm); + m_dma_floppy->set_address_space(bm); + m_dma_sccatx->set_address_space(bm); + m_dma_sccarx->set_address_space(bm); + m_dma_sccbtx->set_address_space(bm); + m_dma_sccbrx->set_address_space(bm); + m_dma_audio_in->set_address_space(bm); + m_dma_audio_out->set_address_space(bm); + command = 2; // enable our memory range revision = 1; @@ -296,7 +297,7 @@ void grandcentral_device::device_start() add_map(0x20000, M_MEM, FUNC(grandcentral_device::map)); // Grand Central only has 128K of BAR space, the others have 512K set_ids(0x106b0002, 0x01, 0xff000001, 0x000000); - m_dma_scsi1->set_address_space(m_pci_memory); + m_dma_scsi1->set_address_space(get_pci_busmaster_space()); } void ohare_device::device_start() @@ -306,8 +307,8 @@ void ohare_device::device_start() set_ids(0x106b0007, 0x01, 0xff0000, 0x000000); save_item(NAME(m_nvram)); - m_dma_ata0->set_address_space(m_pci_memory); - m_dma_ata1->set_address_space(m_pci_memory); + m_dma_ata0->set_address_space(get_pci_busmaster_space()); + m_dma_ata1->set_address_space(get_pci_busmaster_space()); } void heathrow_device::device_start() diff --git a/src/mame/apple/heathrow.h b/src/mame/apple/heathrow.h index dd7715a37dc..9ef9d97ef0c 100644 --- a/src/mame/apple/heathrow.h +++ b/src/mame/apple/heathrow.h @@ -32,7 +32,6 @@ class macio_device : public pci_device auto codec_w_callback() { return write_codec.bind(); } template void set_maincpu_tag(T &&... args) { m_maincpu.set_tag(std::forward(args)...); } - template void set_pci_root_tag(T &&... args) { m_pci_memory.set_tag(std::forward(args)...); } void cb1_w(int state); void cb2_w(int state); @@ -86,7 +85,6 @@ class macio_device : public pci_device required_device m_scc; required_device m_dma_scsi, m_dma_floppy, m_dma_sccatx, m_dma_sccarx; required_device m_dma_sccbtx, m_dma_sccbrx, m_dma_audio_in, m_dma_audio_out; - required_address_space m_pci_memory; private: floppy_image_device *m_cur_floppy = nullptr; diff --git a/src/mame/apple/imacg3.cpp b/src/mame/apple/imacg3.cpp index 8169a8786a2..79f4260b967 100644 --- a/src/mame/apple/imacg3.cpp +++ b/src/mame/apple/imacg3.cpp @@ -160,7 +160,6 @@ void imac_state::imac(machine_config &config) paddington_device &paddington(PADDINGTON(config, "pci:10.0", 0)); paddington.set_maincpu_tag("maincpu"); - paddington.set_pci_root_tag(":pci:00.0", AS_DATA); paddington.irq_callback().set(FUNC(imac_state::irq_w)); atirage_device &ati(ATI_RAGEIIC(config, "pci:12.0", 14.318181_MHz_XTAL)); diff --git a/src/mame/apple/pippin.cpp b/src/mame/apple/pippin.cpp index c8784893409..25508016758 100644 --- a/src/mame/apple/pippin.cpp +++ b/src/mame/apple/pippin.cpp @@ -181,7 +181,6 @@ void pippin_state::pippin(machine_config &config) grandcentral_device &grandcentral(GRAND_CENTRAL(config, "pci:0d.0", 0)); grandcentral.set_maincpu_tag("maincpu"); - grandcentral.set_pci_root_tag(":pci:00.0", AS_DATA); grandcentral.irq_callback().set(FUNC(pippin_state::irq_w)); awacs_macrisc_device &awacs(AWACS_MACRISC(config, "codec", 45.1584_MHz_XTAL / 2)); diff --git a/src/mame/apple/powermacg3.cpp b/src/mame/apple/powermacg3.cpp index 70e90e33085..efe2e7c99d4 100644 --- a/src/mame/apple/powermacg3.cpp +++ b/src/mame/apple/powermacg3.cpp @@ -149,7 +149,6 @@ void pwrmacg3_state::pwrmacg3(machine_config &config) heathrow_device &heathrow(HEATHROW(config, "pci:10.0", 0)); heathrow.set_maincpu_tag("maincpu"); - heathrow.set_pci_root_tag(":pci:00.0", AS_DATA); // Apple's documentation says systems with the 4.0f2 ROM use a Rage II+, but // the 4.0f2 ROM won't init the Rage if the PCI ID is 4755 (II+), only 4754 (Rage II). diff --git a/src/mame/pc/nforcepc.cpp b/src/mame/pc/nforcepc.cpp index f2c431c10e9..21dd4604776 100644 --- a/src/mame/pc/nforcepc.cpp +++ b/src/mame/pc/nforcepc.cpp @@ -97,8 +97,7 @@ void crush11_host_device::device_start() { pci_host_device::device_start(); set_multifunction_device(true); - memory_space = &cpu->space(AS_DATA); - io_space = &cpu->space(AS_IO); + set_spaces(&cpu->space(AS_DATA), &cpu->space(AS_IO)); memory_window_start = 0; memory_window_end = 0xffffffff; diff --git a/src/mame/sega/315-6154.cpp b/src/mame/sega/315-6154.cpp index 633a88de447..9fcdbf42da8 100644 --- a/src/mame/sega/315-6154.cpp +++ b/src/mame/sega/315-6154.cpp @@ -20,7 +20,7 @@ sega_315_6154_device::sega_315_6154_device(const machine_config &mconfig, const void sega_315_6154_device::device_start() { pci_host_device::device_start(); - memory_space = &space(AS_PCI_MEMORY); + set_spaces(&space(AS_PCI_MEMORY)); // never unmap addresses lower than start memory_window_start = 0x80000000; memory_window_end = 0xffffffff; @@ -28,7 +28,6 @@ void sega_315_6154_device::device_start() m_configuration = &space(AS_PCI_CONFIG); - io_space = memory_space; io_window_start = 0xc0000000; io_window_end = 0xc000ffff; io_offset = 0xc0000000; @@ -112,7 +111,7 @@ void sega_315_6154_device::registers_w(offs_t offset, u32 data, u32 mem_mask) logerror("got dma transfer request from 0x%08x to 0x%08x size 0x%08x bytes\n", s, d, l << 2); while (l != 0) { - memory_space->write_dword(d, memory_space->read_dword(s)); + space(AS_PCI_MEMORY).write_dword(d, space(AS_PCI_MEMORY).read_dword(s)); s += 4; d += 4; l--; @@ -123,7 +122,7 @@ void sega_315_6154_device::registers_w(offs_t offset, u32 data, u32 mem_mask) } template -u32 sega_315_6154_device::aperture_r(address_space &space, offs_t offset, u32 mem_mask) +u32 sega_315_6154_device::aperture_r(offs_t offset, u32 mem_mask) { const u32 destination_offset = offset & 0x3fffff; const int destination = (offset >> 22) & 3; @@ -133,15 +132,15 @@ u32 sega_315_6154_device::aperture_r(address_space &space, offs_t offset, u32 me return m_configuration->read_dword(destination_offset << 2, mem_mask); if ((Aperture == 1) && (destination == 0) && (m_useconfig_18x == true)) return m_configuration->read_dword(destination_offset << 2, mem_mask); - return memory_space->read_dword(m_bases[index] + (destination_offset << 2), mem_mask); + return space(AS_PCI_MEMORY).read_dword(m_bases[index] + (destination_offset << 2), mem_mask); } -template u32 sega_315_6154_device::aperture_r<0>(address_space &space, offs_t offset, u32 mem_mask); -template u32 sega_315_6154_device::aperture_r<1>(address_space &space, offs_t offset, u32 mem_mask); -template u32 sega_315_6154_device::aperture_r<2>(address_space &space, offs_t offset, u32 mem_mask); +template u32 sega_315_6154_device::aperture_r<0>(offs_t offset, u32 mem_mask); +template u32 sega_315_6154_device::aperture_r<1>(offs_t offset, u32 mem_mask); +template u32 sega_315_6154_device::aperture_r<2>(offs_t offset, u32 mem_mask); template -void sega_315_6154_device::aperture_w(address_space &space, offs_t offset, u32 data, u32 mem_mask) +void sega_315_6154_device::aperture_w(offs_t offset, u32 data, u32 mem_mask) { const u32 destination_offset = offset & 0x3fffff; const int destination = (offset >> 22) & 3; @@ -157,9 +156,9 @@ void sega_315_6154_device::aperture_w(address_space &space, offs_t offset, u32 d m_configuration->write_dword(destination_offset << 2, data, mem_mask); return; } - memory_space->write_dword(m_bases[index] + (destination_offset << 2), data, mem_mask); + space(AS_PCI_MEMORY).write_dword(m_bases[index] + (destination_offset << 2), data, mem_mask); } -template void sega_315_6154_device::aperture_w<0>(address_space &space, offs_t offset, u32 data, u32 mem_mask); -template void sega_315_6154_device::aperture_w<1>(address_space &space, offs_t offset, u32 data, u32 mem_mask); -template void sega_315_6154_device::aperture_w<2>(address_space &space, offs_t offset, u32 data, u32 mem_mask); +template void sega_315_6154_device::aperture_w<0>(offs_t offset, u32 data, u32 mem_mask); +template void sega_315_6154_device::aperture_w<1>(offs_t offset, u32 data, u32 mem_mask); +template void sega_315_6154_device::aperture_w<2>(offs_t offset, u32 data, u32 mem_mask); diff --git a/src/mame/sega/315-6154.h b/src/mame/sega/315-6154.h index 1dcd6c9e83a..0f036be5636 100644 --- a/src/mame/sega/315-6154.h +++ b/src/mame/sega/315-6154.h @@ -14,14 +14,13 @@ class sega_315_6154_device : public pci_host_device public: // construction/destruction sega_315_6154_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - address_space *memory() { return memory_space; } u32 registers_r(offs_t offset); void registers_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffff); template - u32 aperture_r(address_space &space, offs_t offset, u32 mem_mask = 0xffffffff); + u32 aperture_r(offs_t offset, u32 mem_mask = 0xffffffff); template - void aperture_w(address_space &space, offs_t offset, u32 data, u32 mem_mask = 0xffffffff); + void aperture_w(offs_t offset, u32 data, u32 mem_mask = 0xffffffff); enum { AS_PCI_MEMORY = 1 diff --git a/src/mame/sega/naomigd.cpp b/src/mame/sega/naomigd.cpp index 77cb4048087..f3baf0e341a 100644 --- a/src/mame/sega/naomigd.cpp +++ b/src/mame/sega/naomigd.cpp @@ -700,12 +700,12 @@ void naomi_gdrom_board::sh4_control_w(uint32_t data) dimm_control = data; if (dimm_control & 2) { - m_315_6154->memory()->unmap_readwrite(0x10000000, 0x10000000 + dimm_data_size - 1); + space_6154->unmap_readwrite(0x10000000, 0x10000000 + dimm_data_size - 1); logerror("Activated 'load mode register' command mode\n"); } else { - m_315_6154->memory()->install_ram(0x10000000, 0x10000000 + dimm_data_size - 1, dimm_des_data.get()); + space_6154->install_ram(0x10000000, 0x10000000 + dimm_data_size - 1, dimm_des_data.get()); } if (((old & 1) == 0) && ((dimm_control & 1) == 1)) set_reset_out(); @@ -1036,7 +1036,7 @@ void naomi_gdrom_board::device_reset() dimm_offsetl = 0; dimm_parameterl = 0; dimm_parameterh = 0; - m_315_6154->memory()->install_ram(0x10000000, 0x10000000 + dimm_data_size - 1, dimm_des_data.get()); + space_6154->install_ram(0x10000000, 0x10000000 + dimm_data_size - 1, dimm_des_data.get()); if (work_mode == 2) // invalidate dimm memory contents by setting the first 2048 bytes to 0 memset(dimm_des_data.get(), 0, 2048); } @@ -1044,7 +1044,7 @@ void naomi_gdrom_board::device_reset() { m_maincpu->set_disable(); m_securitycpu->set_disable(); - m_315_6154->memory()->unmap_readwrite(0x10000000, 0x10000000 + dimm_data_size - 1); + space_6154->unmap_readwrite(0x10000000, 0x10000000 + dimm_data_size - 1); } dimm_cur_address = 0; diff --git a/src/mame/shared/xbox_pci.cpp b/src/mame/shared/xbox_pci.cpp index ba218745e98..3b850664acf 100644 --- a/src/mame/shared/xbox_pci.cpp +++ b/src/mame/shared/xbox_pci.cpp @@ -39,8 +39,7 @@ void nv2a_host_device::map_extra(uint64_t memory_window_start, uint64_t memory_w void nv2a_host_device::device_start() { pci_host_device::device_start(); - memory_space = &cpu->space(AS_PROGRAM); - io_space = &cpu->space(AS_IO); + set_spaces(&cpu->space(AS_PROGRAM), &cpu->space(AS_IO)); // do not change the next two memory_window_start = 0x10000000;