bus/mtx: Configure spaces using required_address_space (nw)

This commit is contained in:
AJR 2019-03-12 10:02:07 -04:00
parent 8169286fcc
commit b3b79ff008
4 changed files with 9 additions and 27 deletions

View File

@ -43,7 +43,8 @@ device_mtx_exp_interface::device_mtx_exp_interface(const machine_config &mconfig
mtx_exp_slot_device::mtx_exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) mtx_exp_slot_device::mtx_exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, MTX_EXP_SLOT, tag, owner, clock) : device_t(mconfig, MTX_EXP_SLOT, tag, owner, clock)
, device_slot_interface(mconfig, *this) , device_slot_interface(mconfig, *this)
, m_io(nullptr) , m_program(*this, finder_base::DUMMY_TAG, -1)
, m_io(*this, finder_base::DUMMY_TAG, -1)
, m_card(nullptr) , m_card(nullptr)
, m_busreq_handler(*this) , m_busreq_handler(*this)
, m_int_handler(*this) , m_int_handler(*this)
@ -90,24 +91,6 @@ void mtx_exp_slot_device::device_reset()
} }
//-------------------------------------------------
// set_program_space - set address space we are attached to
//-------------------------------------------------
void mtx_exp_slot_device::set_program_space(address_space *program)
{
m_program = program;
}
//-------------------------------------------------
// set_io_space - set address space we are attached to
//-------------------------------------------------
void mtx_exp_slot_device::set_io_space(address_space *io)
{
m_io = io;
}
//------------------------------------------------- //-------------------------------------------------
// SLOT_INTERFACE( mtx_exp_devices ) // SLOT_INTERFACE( mtx_exp_devices )
//------------------------------------------------- //-------------------------------------------------

View File

@ -37,8 +37,8 @@ public:
mtx_exp_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock = 0); mtx_exp_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock = 0);
void set_program_space(address_space *program); template <typename T> void set_program_space(T &&tag, int spacenum) { m_program.set_tag(std::forward<T>(tag), spacenum); }
void set_io_space(address_space *io); template <typename T> void set_io_space(T &&tag, int spacenum) { m_io.set_tag(std::forward<T>(tag), spacenum); }
// callbacks // callbacks
auto busreq_handler() { return m_busreq_handler.bind(); } auto busreq_handler() { return m_busreq_handler.bind(); }
@ -49,8 +49,9 @@ public:
DECLARE_WRITE_LINE_MEMBER( int_w ) { m_int_handler(state); } DECLARE_WRITE_LINE_MEMBER( int_w ) { m_int_handler(state); }
DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_nmi_handler(state); } DECLARE_WRITE_LINE_MEMBER( nmi_w ) { m_nmi_handler(state); }
address_space *m_program; // address spaces we are attached to
address_space *m_io; required_address_space m_program;
required_address_space m_io;
protected: protected:
// device-level overrides // device-level overrides

View File

@ -338,6 +338,8 @@ void mtx_state::mtx512(machine_config &config)
/* rs232 board with disk drive bus */ /* rs232 board with disk drive bus */
MTX_EXP_SLOT(config, m_exp, mtx_expansion_devices, nullptr); MTX_EXP_SLOT(config, m_exp, mtx_expansion_devices, nullptr);
m_exp->set_program_space(m_maincpu, AS_PROGRAM);
m_exp->set_io_space(m_maincpu, AS_IO);
m_exp->int_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0); m_exp->int_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
m_exp->nmi_handler().set_inputline(m_maincpu, INPUT_LINE_NMI); m_exp->nmi_handler().set_inputline(m_maincpu, INPUT_LINE_NMI);
m_exp->busreq_handler().set_inputline(m_maincpu, Z80_INPUT_LINE_BUSRQ); m_exp->busreq_handler().set_inputline(m_maincpu, Z80_INPUT_LINE_BUSRQ);

View File

@ -565,10 +565,6 @@ void mtx_state::machine_start()
/* install 4000h bytes common block */ /* install 4000h bytes common block */
program.install_ram(0xc000, 0xffff, m_ram->pointer()); program.install_ram(0xc000, 0xffff, m_ram->pointer());
/* setup expansion slot */
m_exp->set_program_space(&m_maincpu->space(AS_PROGRAM));
m_exp->set_io_space(&m_maincpu->space(AS_IO));
} }
void mtx_state::machine_reset() void mtx_state::machine_reset()