diff options
author | 2019-02-25 20:45:30 -0500 | |
---|---|---|
committer | 2019-02-25 20:46:19 -0500 | |
commit | 579e277fda9289c23fc7770794a5698eba263856 (patch) | |
tree | 5384c5ac01894b296203efc5d39584c024b535cc /src/devices/bus/hp_dio | |
parent | 8fc8ae62a7130cc00510fec3359988d29c7ed40e (diff) |
bus/hp_dio: Replace CPU finder with required_address_space (nw)
Diffstat (limited to 'src/devices/bus/hp_dio')
-rw-r--r-- | src/devices/bus/hp_dio/hp98265a.cpp | 4 | ||||
-rw-r--r-- | src/devices/bus/hp_dio/hp98620.cpp | 6 | ||||
-rw-r--r-- | src/devices/bus/hp_dio/hp98643.cpp | 2 | ||||
-rw-r--r-- | src/devices/bus/hp_dio/hp_dio.cpp | 6 | ||||
-rw-r--r-- | src/devices/bus/hp_dio/hp_dio.h | 9 | ||||
-rw-r--r-- | src/devices/bus/hp_dio/human_interface.cpp | 4 |
6 files changed, 14 insertions, 17 deletions
diff --git a/src/devices/bus/hp_dio/hp98265a.cpp b/src/devices/bus/hp_dio/hp98265a.cpp index baafc4e14eb..c5c28eeda6b 100644 --- a/src/devices/bus/hp_dio/hp98265a.cpp +++ b/src/devices/bus/hp_dio/hp98265a.cpp @@ -168,12 +168,12 @@ void dio16_98265a_device::device_reset() code &= REG_SW1_SELECT_CODE_MASK; if (!m_installed_io) { - program_space()->install_readwrite_handler( + program_space().install_readwrite_handler( 0x600000 + (code * 0x10000), 0x6007ff + (code * 0x10000), read16_delegate(FUNC(dio16_98265a_device::io_r), this), write16_delegate(FUNC(dio16_98265a_device::io_w), this)); - program_space()->install_device(0x6e0020, 0x6e003f, *m_spc, &mb87030_device::map, 0x00ff00ff); + program_space().install_device(0x6e0020, 0x6e003f, *m_spc, &mb87030_device::map, 0x00ff00ff); m_installed_io = true; } m_control = 0; diff --git a/src/devices/bus/hp_dio/hp98620.cpp b/src/devices/bus/hp_dio/hp98620.cpp index 2fdc8e0f932..fcd0e9d95aa 100644 --- a/src/devices/bus/hp_dio/hp98620.cpp +++ b/src/devices/bus/hp_dio/hp98620.cpp @@ -74,7 +74,7 @@ void dio16_98620_device::device_reset() { if (!m_installed_io) { - program_space()->install_readwrite_handler(0x500000, 0x50020f, + program_space().install_readwrite_handler(0x500000, 0x50020f, read16_delegate(FUNC(dio16_98620_device::dma_r), this), write16_delegate(FUNC(dio16_98620_device::dma_w), this)); m_installed_io = true; @@ -343,9 +343,9 @@ void dio16_98620_device::dma_transfer(int channel) if (m_regs[channel].dma_out) { - dmack_w_out(channel, program_space()->read_byte(m_regs[channel].address++)); + dmack_w_out(channel, program_space().read_byte(m_regs[channel].address++)); } else { - program_space()->write_byte(m_regs[channel].address++, dmack_r_out(channel)); + program_space().write_byte(m_regs[channel].address++, dmack_r_out(channel)); } diff --git a/src/devices/bus/hp_dio/hp98643.cpp b/src/devices/bus/hp_dio/hp98643.cpp index 5a439144d6d..57bc4d1a283 100644 --- a/src/devices/bus/hp_dio/hp98643.cpp +++ b/src/devices/bus/hp_dio/hp98643.cpp @@ -105,7 +105,7 @@ void dio16_98643_device::device_reset() uint32_t baseaddr = 0x600000 + (code << 16); - program_space()->install_device(baseaddr, baseaddr + 0xffff, + program_space().install_device(baseaddr, baseaddr + 0xffff, *this, &dio16_98643_device::addrmap); m_installed_io = true; } diff --git a/src/devices/bus/hp_dio/hp_dio.cpp b/src/devices/bus/hp_dio/hp_dio.cpp index dfa228dc8af..c2cbfa8e941 100644 --- a/src/devices/bus/hp_dio/hp_dio.cpp +++ b/src/devices/bus/hp_dio/hp_dio.cpp @@ -104,8 +104,7 @@ dio16_device::dio16_device(const machine_config &mconfig, const char *tag, devic dio16_device::dio16_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(*this, finder_base::DUMMY_TAG), - m_prgspace(nullptr), + m_prgspace(*this, finder_base::DUMMY_TAG, -1), m_irq1_out_cb(*this), m_irq2_out_cb(*this), m_irq3_out_cb(*this), @@ -136,8 +135,7 @@ void dio16_device::device_start() m_dmar0_out_cb.resolve_safe(); m_dmar1_out_cb.resolve_safe(); - m_prgspace = &m_maincpu->space(AS_PROGRAM); - m_prgwidth = m_maincpu->space_config(AS_PROGRAM)->data_width(); + m_prgwidth = m_prgspace->data_width(); save_item(NAME(m_irq)); save_item(NAME(m_dmar)); diff --git a/src/devices/bus/hp_dio/hp_dio.h b/src/devices/bus/hp_dio/hp_dio.h index ddf95e9570c..ee680b08d4b 100644 --- a/src/devices/bus/hp_dio/hp_dio.h +++ b/src/devices/bus/hp_dio/hp_dio.h @@ -65,7 +65,7 @@ public: // construction/destruction dio16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // inline configuration - template <typename T> void set_cputag(T &&tag) { m_maincpu.set_tag(std::forward<T>(tag)); } + template <typename T> void set_program_space(T &&tag, int spacenum) { m_prgspace.set_tag(std::forward<T>(tag), spacenum); } // callback configuration auto dmar0_out_cb() { return m_dmar0_out_cb.bind(); } @@ -89,7 +89,7 @@ public: void unmap_bank(offs_t start, offs_t end); void unmap_rom(offs_t start, offs_t end); - address_space *program_space() { return m_prgspace; } + address_space &program_space() { return *m_prgspace; } // IRQs 1, 2, and 7 are reserved for non-bus usage. @@ -137,11 +137,10 @@ protected: virtual void device_reset() override; // internal state - required_device<cpu_device> m_maincpu; std::list<device_dio16_card_interface *> m_cards; // address spaces - address_space *m_prgspace; + required_address_space m_prgspace; int m_bus_index; // packed line states @@ -187,7 +186,7 @@ protected: virtual void interface_pre_start() override; int get_index() { return m_index; }; - address_space *program_space() { return m_dio_dev->program_space(); } + address_space &program_space() { return m_dio_dev->program_space(); } DECLARE_WRITE_LINE_MEMBER(irq1_out) { m_dio_dev->set_irq(m_index, 0, state); } DECLARE_WRITE_LINE_MEMBER(irq2_out) { m_dio_dev->set_irq(m_index, 1, state); } diff --git a/src/devices/bus/hp_dio/human_interface.cpp b/src/devices/bus/hp_dio/human_interface.cpp index 58e3bff68aa..d7cfad37d50 100644 --- a/src/devices/bus/hp_dio/human_interface.cpp +++ b/src/devices/bus/hp_dio/human_interface.cpp @@ -114,11 +114,11 @@ human_interface_device::human_interface_device(const machine_config &mconfig, de void human_interface_device::device_start() { - program_space()->install_readwrite_handler(0x420000, 0x420003, 0x0003, 0xfffc, 0, + program_space().install_readwrite_handler(0x420000, 0x420003, 0x0003, 0xfffc, 0, read8_delegate(FUNC(upi41_cpu_device::upi41_master_r), &(*m_iocpu)), write8_delegate(FUNC(upi41_cpu_device::upi41_master_w), &(*m_iocpu)), 0x00ff00ff); - program_space()->install_readwrite_handler(0x470000, 0x47001f, 0x1f, 0xffe0, 0, + program_space().install_readwrite_handler(0x470000, 0x47001f, 0x1f, 0xffe0, 0, read8_delegate(FUNC(human_interface_device::gpib_r), this), write8_delegate(FUNC(human_interface_device::gpib_w), this), 0x00ff00ff); |