mirror of
https://github.com/holub/mame
synced 2025-04-28 11:11:48 +03:00
bus/apricot/expansion: Replace CPU finders with address space finders (nw)
This commit is contained in:
parent
8efc7c322b
commit
3041d13692
@ -59,18 +59,16 @@ DEFINE_DEVICE_TYPE(APRICOT_EXPANSION_BUS, apricot_expansion_bus_device, "apricot
|
||||
|
||||
apricot_expansion_bus_device::apricot_expansion_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, APRICOT_EXPANSION_BUS, tag, owner, clock),
|
||||
m_program(nullptr),
|
||||
m_io(nullptr),
|
||||
m_program_iop(nullptr),
|
||||
m_io_iop(nullptr),
|
||||
m_program(*this, finder_base::DUMMY_TAG, -1),
|
||||
m_io(*this, finder_base::DUMMY_TAG, -1),
|
||||
m_program_iop(*this, finder_base::DUMMY_TAG, -1),
|
||||
m_io_iop(*this, finder_base::DUMMY_TAG, -1),
|
||||
m_dma1_handler(*this),
|
||||
m_dma2_handler(*this),
|
||||
m_ext1_handler(*this),
|
||||
m_ext2_handler(*this),
|
||||
m_int2_handler(*this),
|
||||
m_int3_handler(*this),
|
||||
m_cpu(*this, finder_base::DUMMY_TAG),
|
||||
m_iop(*this, finder_base::DUMMY_TAG)
|
||||
m_int3_handler(*this)
|
||||
{
|
||||
}
|
||||
|
||||
@ -98,19 +96,6 @@ void apricot_expansion_bus_device::device_start()
|
||||
m_int3_handler.resolve_safe();
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void apricot_expansion_bus_device::device_reset()
|
||||
{
|
||||
m_program = &m_cpu->space(AS_PROGRAM);
|
||||
m_io = &m_cpu->space(AS_IO);
|
||||
|
||||
m_program_iop = &m_iop->space(AS_PROGRAM);
|
||||
m_io_iop = &m_iop->space(AS_IO);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// add_card - add new card to our bus
|
||||
//-------------------------------------------------
|
||||
|
@ -89,16 +89,14 @@ class apricot_expansion_bus_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
template <typename T, typename U>
|
||||
apricot_expansion_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&cpu_tag, U &&iop_tag)
|
||||
: apricot_expansion_bus_device(mconfig, tag, owner, (uint32_t)0)
|
||||
{
|
||||
m_cpu.set_tag(std::forward<T>(cpu_tag));
|
||||
m_iop.set_tag(std::forward<U>(iop_tag));
|
||||
}
|
||||
apricot_expansion_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
virtual ~apricot_expansion_bus_device();
|
||||
|
||||
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); }
|
||||
template <typename T> void set_program_iop_space(T &&tag, int spacenum) { m_program_iop.set_tag(std::forward<T>(tag), spacenum); }
|
||||
template <typename T> void set_io_iop_space(T &&tag, int spacenum) { m_io_iop.set_tag(std::forward<T>(tag), spacenum); }
|
||||
|
||||
auto dma1() { return m_dma1_handler.bind(); }
|
||||
auto dma2() { return m_dma2_handler.bind(); }
|
||||
auto ext1() { return m_ext1_handler.bind(); }
|
||||
@ -129,16 +127,15 @@ public:
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
private:
|
||||
simple_list<device_apricot_expansion_card_interface> m_dev;
|
||||
|
||||
// address spaces we have access to
|
||||
address_space *m_program;
|
||||
address_space *m_io;
|
||||
address_space *m_program_iop;
|
||||
address_space *m_io_iop;
|
||||
required_address_space m_program;
|
||||
required_address_space m_io;
|
||||
optional_address_space m_program_iop;
|
||||
optional_address_space m_io_iop;
|
||||
|
||||
devcb_write_line m_dma1_handler;
|
||||
devcb_write_line m_dma2_handler;
|
||||
@ -146,10 +143,6 @@ private:
|
||||
devcb_write_line m_ext2_handler;
|
||||
devcb_write_line m_int2_handler;
|
||||
devcb_write_line m_int3_handler;
|
||||
|
||||
// configuration
|
||||
required_device<cpu_device> m_cpu;
|
||||
required_device<cpu_device> m_iop;
|
||||
};
|
||||
|
||||
// device type definition
|
||||
|
@ -473,7 +473,11 @@ void apricot_state::apricot(machine_config &config)
|
||||
SOFTWARE_LIST(config, "flop_list").set_original("apricot_flop");
|
||||
|
||||
// expansion bus
|
||||
APRICOT_EXPANSION_BUS(config, m_exp, m_cpu, m_iop);
|
||||
APRICOT_EXPANSION_BUS(config, m_exp, 0);
|
||||
m_exp->set_program_space(m_cpu, AS_PROGRAM);
|
||||
m_exp->set_io_space(m_cpu, AS_IO);
|
||||
m_exp->set_program_iop_space(m_iop, AS_PROGRAM);
|
||||
m_exp->set_io_iop_space(m_iop, AS_IO);
|
||||
m_exp->int2().set(m_pic, FUNC(pic8259_device::ir2_w));
|
||||
m_exp->int3().set(m_pic, FUNC(pic8259_device::ir3_w));
|
||||
APRICOT_EXPANSION_SLOT(config, "exp:1", apricot_expansion_cards, nullptr);
|
||||
|
Loading…
Reference in New Issue
Block a user