diff options
Diffstat (limited to 'src/devices/bus/nubus/nubus.cpp')
-rw-r--r-- | src/devices/bus/nubus/nubus.cpp | 56 |
1 files changed, 25 insertions, 31 deletions
diff --git a/src/devices/bus/nubus/nubus.cpp b/src/devices/bus/nubus/nubus.cpp index b0fc2a4667d..dc7db80a2ef 100644 --- a/src/devices/bus/nubus/nubus.cpp +++ b/src/devices/bus/nubus/nubus.cpp @@ -70,23 +70,24 @@ nubus_device::nubus_device(const machine_config &mconfig, const char *tag, devic nubus_device::nubus_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), - m_maincpu(nullptr), + m_space(*this, finder_base::DUMMY_TAG, -1), m_out_irq9_cb(*this), m_out_irqa_cb(*this), m_out_irqb_cb(*this), m_out_irqc_cb(*this), m_out_irqd_cb(*this), - m_out_irqe_cb(*this), - m_cputag(nullptr) + m_out_irqe_cb(*this) { } + //------------------------------------------------- -// device_start - device-specific startup +// device_resolve_objects - resolve objects that +// may be needed for other devices to set +// initial conditions at start time //------------------------------------------------- -void nubus_device::device_start() +void nubus_device::device_resolve_objects() { - m_maincpu = machine().device<cpu_device>(m_cputag); // resolve callbacks m_out_irq9_cb.resolve_safe(); m_out_irqa_cb.resolve_safe(); @@ -97,10 +98,10 @@ void nubus_device::device_start() } //------------------------------------------------- -// device_reset - device-specific reset +// device_start - device-specific startup //------------------------------------------------- -void nubus_device::device_reset() +void nubus_device::device_start() { } @@ -111,15 +112,14 @@ void nubus_device::add_nubus_card(device_nubus_card_interface *card) void nubus_device::install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler, uint32_t mask) { - m_maincpu = machine().device<cpu_device>(m_cputag); - int buswidth = m_maincpu->space_config(AS_PROGRAM)->data_width(); + int buswidth = m_space->data_width(); switch(buswidth) { case 32: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, mask); + m_space->install_readwrite_handler(start, end, rhandler, whandler, mask); break; case 64: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, ((uint64_t)mask<<32)|mask); + m_space->install_readwrite_handler(start, end, rhandler, whandler, ((uint64_t)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); @@ -128,15 +128,14 @@ void nubus_device::install_device(offs_t start, offs_t end, read8_delegate rhand void nubus_device::install_device(offs_t start, offs_t end, read16_delegate rhandler, write16_delegate whandler, uint32_t mask) { - m_maincpu = machine().device<cpu_device>(m_cputag); - int buswidth = m_maincpu->space_config(AS_PROGRAM)->data_width(); + int buswidth = m_space->data_width(); switch(buswidth) { case 32: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, mask); + m_space->install_readwrite_handler(start, end, rhandler, whandler, mask); break; case 64: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, ((uint64_t)mask<<32)|mask); + m_space->install_readwrite_handler(start, end, rhandler, whandler, ((uint64_t)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); @@ -145,15 +144,14 @@ void nubus_device::install_device(offs_t start, offs_t end, read16_delegate rhan void nubus_device::install_device(offs_t start, offs_t end, read32_delegate rhandler, write32_delegate whandler, uint32_t mask) { - m_maincpu = machine().device<cpu_device>(m_cputag); - int buswidth = m_maincpu->space_config(AS_PROGRAM)->data_width(); + int buswidth = m_space->data_width(); switch(buswidth) { case 32: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, mask); + m_space->install_readwrite_handler(start, end, rhandler, whandler, mask); break; case 64: - m_maincpu->space(AS_PROGRAM).install_readwrite_handler(start, end, rhandler, whandler, ((uint64_t)mask<<32)|mask); + m_space->install_readwrite_handler(start, end, rhandler, whandler, ((uint64_t)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); @@ -162,15 +160,14 @@ void nubus_device::install_device(offs_t start, offs_t end, read32_delegate rhan void nubus_device::install_readonly_device(offs_t start, offs_t end, read32_delegate rhandler, uint32_t mask) { - m_maincpu = machine().device<cpu_device>(m_cputag); - int buswidth = m_maincpu->space_config(AS_PROGRAM)->data_width(); + int buswidth = m_space->data_width(); switch(buswidth) { case 32: - m_maincpu->space(AS_PROGRAM).install_read_handler(start, end, rhandler, mask); + m_space->install_read_handler(start, end, rhandler, mask); break; case 64: - m_maincpu->space(AS_PROGRAM).install_read_handler(start, end, rhandler, ((uint64_t)mask<<32)|mask); + m_space->install_read_handler(start, end, rhandler, ((uint64_t)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); @@ -179,15 +176,14 @@ void nubus_device::install_readonly_device(offs_t start, offs_t end, read32_dele void nubus_device::install_writeonly_device(offs_t start, offs_t end, write32_delegate whandler, uint32_t mask) { - m_maincpu = machine().device<cpu_device>(m_cputag); - int buswidth = m_maincpu->space_config(AS_PROGRAM)->data_width(); + int buswidth = m_space->data_width(); switch(buswidth) { case 32: - m_maincpu->space(AS_PROGRAM).install_write_handler(start, end, whandler, mask); + m_space->install_write_handler(start, end, whandler, mask); break; case 64: - m_maincpu->space(AS_PROGRAM).install_write_handler(start, end, whandler, ((uint64_t)mask<<32)|mask); + m_space->install_write_handler(start, end, whandler, ((uint64_t)mask<<32)|mask); break; default: fatalerror("NUBUS: Bus width %d not supported\n", buswidth); @@ -197,9 +193,7 @@ void nubus_device::install_writeonly_device(offs_t start, offs_t end, write32_de void nubus_device::install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data) { // printf("install_bank: %s @ %x->%x\n", tag, start, end); - m_maincpu = machine().device<cpu_device>(m_cputag); - address_space &space = m_maincpu->space(AS_PROGRAM); - space.install_readwrite_bank(start, end, 0, tag ); + m_space->install_readwrite_bank(start, end, 0, tag); machine().root_device().membank(siblingtag(tag).c_str())->set_base(data); } |