diff options
author | 2019-02-25 19:59:38 -0500 | |
---|---|---|
committer | 2019-02-25 19:59:38 -0500 | |
commit | d4370f150dc811b15a66111a98352b16a066e1fe (patch) | |
tree | 9be9aed7d47f8988134027e29b72678e6d1fde2c /src/devices/bus/einstein | |
parent | 7a8a8cc5dbe6e1595b370f090d3477a9900c62a7 (diff) |
bus/cgenie/expansion, bus/einstein/pipe, bus/nasbus, bus/spectrum, bus/vtech: Install spaces through finders (nw)
Diffstat (limited to 'src/devices/bus/einstein')
-rw-r--r-- | src/devices/bus/einstein/pipe/pipe.cpp | 44 | ||||
-rw-r--r-- | src/devices/bus/einstein/pipe/pipe.h | 9 | ||||
-rw-r--r-- | src/devices/bus/einstein/pipe/tk02.cpp | 3 |
3 files changed, 29 insertions, 27 deletions
diff --git a/src/devices/bus/einstein/pipe/pipe.cpp b/src/devices/bus/einstein/pipe/pipe.cpp index b40038e650b..d521d146325 100644 --- a/src/devices/bus/einstein/pipe/pipe.cpp +++ b/src/devices/bus/einstein/pipe/pipe.cpp @@ -33,8 +33,8 @@ DEFINE_DEVICE_TYPE(TATUNG_PIPE, tatung_pipe_device, "tatung_pipe", "Tatung Pipe tatung_pipe_device::tatung_pipe_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TATUNG_PIPE, tag, owner, clock), device_slot_interface(mconfig, *this), - m_program(nullptr), - m_io(nullptr), + m_program(*this, finder_base::DUMMY_TAG, -1), + m_io(*this, finder_base::DUMMY_TAG, -1), m_card(nullptr), m_int_handler(*this), m_nmi_handler(*this), @@ -51,6 +51,28 @@ tatung_pipe_device::~tatung_pipe_device() } //------------------------------------------------- +// device_config_complete - perform any +// operations now that the configuration is +// complete +//------------------------------------------------- + +void tatung_pipe_device::device_config_complete() +{ + // for passthrough connectors, use the parent slot's spaces + if (dynamic_cast<device_tatung_pipe_interface *>(owner()) != nullptr) + { + auto parent = dynamic_cast<tatung_pipe_device *>(owner()->owner()); + if (parent != nullptr) + { + if (m_program.finder_tag() == finder_base::DUMMY_TAG) + m_program.set_tag(parent->m_program, parent->m_program.spacenum()); + if (m_io.finder_tag() == finder_base::DUMMY_TAG) + m_io.set_tag(parent->m_io, parent->m_io.spacenum()); + } + } +} + +//------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- @@ -83,24 +105,6 @@ WRITE_LINE_MEMBER( tatung_pipe_device::host_int_w ) m_card->int_w(state); } -//------------------------------------------------- -// set_program_space - set address space we are attached to -//------------------------------------------------- - -void tatung_pipe_device::set_program_space(address_space *program) -{ - m_program = program; -} - -//------------------------------------------------- -// set_io_space - set address space we are attached to -//------------------------------------------------- - -void tatung_pipe_device::set_io_space(address_space *io) -{ - m_io = io; -} - //************************************************************************** // CARD INTERFACE diff --git a/src/devices/bus/einstein/pipe/pipe.h b/src/devices/bus/einstein/pipe/pipe.h index e0ce7e9a6f7..f0c32bd0043 100644 --- a/src/devices/bus/einstein/pipe/pipe.h +++ b/src/devices/bus/einstein/pipe/pipe.h @@ -68,8 +68,8 @@ public: } virtual ~tatung_pipe_device(); - void set_program_space(address_space *program); - void set_io_space(address_space *io); + template <typename T> void set_program_space(T &&tag, int spacenum) { m_program.set_tag(std::forward<T>(tag), spacenum); } + template <typename T> void set_io_space(T &&tag, int spacenum) { m_io.set_tag(std::forward<T>(tag), spacenum); } // callbacks auto int_handler() { return m_int_handler.bind(); } @@ -86,11 +86,12 @@ public: protected: // device-level overrides + virtual void device_config_complete() override; virtual void device_start() override; virtual void device_reset() override; - address_space *m_program; - address_space *m_io; + required_address_space m_program; + required_address_space m_io; device_tatung_pipe_interface *m_card; diff --git a/src/devices/bus/einstein/pipe/tk02.cpp b/src/devices/bus/einstein/pipe/tk02.cpp index d0926f2e320..311c3099011 100644 --- a/src/devices/bus/einstein/pipe/tk02.cpp +++ b/src/devices/bus/einstein/pipe/tk02.cpp @@ -159,9 +159,6 @@ void tk02_device::device_start() void tk02_device::device_reset() { - m_pipe->set_io_space(&io_space()); - m_pipe->set_program_space(&program_space()); - io_space().install_device(0x40, 0x4f, *this, &tk02_device::map); io_space().install_readwrite_handler(0x40, 0x47, 0, 0, 0xff00, read8_delegate(FUNC(tk02_device::ram_r), this), write8_delegate(FUNC(tk02_device::ram_w), this)); } |