mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
bus/mtx: Configure spaces using required_address_space (nw)
This commit is contained in:
parent
8169286fcc
commit
b3b79ff008
@ -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)
|
||||
: device_t(mconfig, MTX_EXP_SLOT, tag, owner, clock)
|
||||
, 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_busreq_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 )
|
||||
//-------------------------------------------------
|
||||
|
@ -37,8 +37,8 @@ public:
|
||||
|
||||
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);
|
||||
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 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( nmi_w ) { m_nmi_handler(state); }
|
||||
|
||||
address_space *m_program;
|
||||
address_space *m_io;
|
||||
// address spaces we are attached to
|
||||
required_address_space m_program;
|
||||
required_address_space m_io;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
|
@ -338,6 +338,8 @@ void mtx_state::mtx512(machine_config &config)
|
||||
|
||||
/* rs232 board with disk drive bus */
|
||||
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->nmi_handler().set_inputline(m_maincpu, INPUT_LINE_NMI);
|
||||
m_exp->busreq_handler().set_inputline(m_maincpu, Z80_INPUT_LINE_BUSRQ);
|
||||
|
@ -565,10 +565,6 @@ void mtx_state::machine_start()
|
||||
|
||||
/* install 4000h bytes common block */
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user