mirror of
https://github.com/holub/mame
synced 2025-05-15 10:28:16 +03:00
machine/idectrl: Another use for required_address_space (nw)
This commit is contained in:
parent
f59d87c93f
commit
d9d7c9d17a
@ -222,6 +222,7 @@ DEFINE_DEVICE_TYPE(BUS_MASTER_IDE_CONTROLLER, bus_master_ide_controller_device,
|
||||
|
||||
bus_master_ide_controller_device::bus_master_ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
ide_controller_32_device(mconfig, BUS_MASTER_IDE_CONTROLLER, tag, owner, clock),
|
||||
m_dma_space(*this, finder_base::DUMMY_TAG, -1, 32),
|
||||
m_dma_address(0),
|
||||
m_dma_bytes_left(0),
|
||||
m_dma_descriptor(0),
|
||||
@ -239,17 +240,7 @@ void bus_master_ide_controller_device::device_start()
|
||||
ide_controller_32_device::device_start();
|
||||
|
||||
/* find the bus master space */
|
||||
if (m_bmcpu != nullptr)
|
||||
{
|
||||
device_t *bmtarget = machine().device(m_bmcpu);
|
||||
if (bmtarget == nullptr)
|
||||
throw emu_fatalerror("IDE controller '%s' bus master target '%s' doesn't exist!", tag(), m_bmcpu);
|
||||
device_memory_interface *memory;
|
||||
if (!bmtarget->interface(memory))
|
||||
throw emu_fatalerror("IDE controller '%s' bus master target '%s' has no memory!", tag(), m_bmcpu);
|
||||
m_dma_space = &memory->space(m_bmspace);
|
||||
m_dma_address_xor = (m_dma_space->endianness() == ENDIANNESS_LITTLE) ? 0 : 3;
|
||||
}
|
||||
m_dma_address_xor = (m_dma_space->endianness() == ENDIANNESS_LITTLE) ? 0 : 3;
|
||||
|
||||
save_item(NAME(m_dma_address));
|
||||
save_item(NAME(m_dma_bytes_left));
|
||||
|
@ -105,7 +105,7 @@ class bus_master_ide_controller_device : public ide_controller_32_device
|
||||
{
|
||||
public:
|
||||
bus_master_ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
void set_bus_master_space(const char *bmcpu, uint32_t bmspace) { m_bmcpu = bmcpu; m_bmspace = bmspace; }
|
||||
template <typename T> void set_bus_master_space(T &&bmtag, int bmspace) { m_dma_space.set_tag(std::forward<T>(bmtag), bmspace); }
|
||||
|
||||
template <typename T> bus_master_ide_controller_device &master(T &&opts, const char *dflt = nullptr, bool fixed = false)
|
||||
{
|
||||
@ -140,9 +140,7 @@ protected:
|
||||
private:
|
||||
void execute_dma();
|
||||
|
||||
const char *m_bmcpu;
|
||||
uint32_t m_bmspace;
|
||||
address_space *m_dma_space;
|
||||
required_address_space m_dma_space;
|
||||
uint8_t m_dma_address_xor;
|
||||
|
||||
offs_t m_dma_address;
|
||||
|
@ -915,7 +915,7 @@ void mcpx_ide_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
bus_master_ide_controller_device &ide(BUS_MASTER_IDE_CONTROLLER(config, "ide", 0));
|
||||
ide.irq_handler().set(FUNC(mcpx_ide_device::ide_interrupt));
|
||||
ide.set_bus_master_space("maincpu", AS_PROGRAM);
|
||||
ide.set_bus_master_space(":maincpu", AS_PROGRAM);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(mcpx_ide_device::ide_interrupt)
|
||||
|
Loading…
Reference in New Issue
Block a user