mirror of
https://github.com/holub/mame
synced 2025-10-09 17:53:01 +03:00
pc9801_cbus: Replace hard-coded CPU tag with configuration macro (nw)
This commit is contained in:
parent
7beb9eb6f2
commit
ad905451e1
@ -55,7 +55,7 @@ device_pc9801cbus_card_interface::~device_pc9801cbus_card_interface()
|
||||
pc9801_slot_device::pc9801_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, PC9801CBUS_SLOT, tag, owner, clock),
|
||||
device_slot_interface(mconfig, *this),
|
||||
m_cpu(*this, "^maincpu"),
|
||||
m_cpu(*this, finder_base::DUMMY_TAG),
|
||||
m_int_callback{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
|
||||
{
|
||||
}
|
||||
|
@ -27,6 +27,9 @@
|
||||
MCFG_DEVICE_ADD(_tag, PC9801CBUS_SLOT, 0) \
|
||||
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
|
||||
|
||||
#define MCFG_PC9801CBUS_CPU(_cputag) \
|
||||
downcast<pc9801_slot_device &>(*device).set_cpu_tag(_cputag);
|
||||
|
||||
#define MCFG_PC9801CBUS_INT0_CALLBACK(_devcb) \
|
||||
devcb = &downcast<pc9801_slot_device &>(*device).set_int_callback<0>(DEVCB_##_devcb);
|
||||
|
||||
@ -79,6 +82,7 @@ public:
|
||||
pc9801_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// configuration access
|
||||
template<class T> void set_cpu_tag(T &&tag) { m_cpu.set_tag(std::forward<T>(tag)); }
|
||||
template<int I, class Object> devcb_base &set_int_callback(Object &&cb) { return m_int_callback[I].set_callback(std::forward<Object>(cb)); }
|
||||
|
||||
address_space &program_space() const { return m_cpu->space(AS_PROGRAM); }
|
||||
|
@ -2227,6 +2227,7 @@ MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(pc9801_state::pc9801_cbus)
|
||||
MCFG_PC9801CBUS_SLOT_ADD("cbus0", pc9801_cbus_devices, "pc9801_26")
|
||||
MCFG_PC9801CBUS_CPU("maincpu")
|
||||
MCFG_PC9801CBUS_INT0_CALLBACK(WRITELINE("ir3", input_merger_device, in_w<0>))
|
||||
MCFG_PC9801CBUS_INT1_CALLBACK(WRITELINE("ir5", input_merger_device, in_w<0>))
|
||||
MCFG_PC9801CBUS_INT2_CALLBACK(WRITELINE("ir6", input_merger_device, in_w<0>))
|
||||
@ -2236,6 +2237,7 @@ MACHINE_CONFIG_START(pc9801_state::pc9801_cbus)
|
||||
MCFG_PC9801CBUS_INT6_CALLBACK(WRITELINE("ir13", input_merger_device, in_w<0>))
|
||||
|
||||
MCFG_PC9801CBUS_SLOT_ADD("cbus1", pc9801_cbus_devices, nullptr)
|
||||
MCFG_PC9801CBUS_CPU("maincpu")
|
||||
MCFG_PC9801CBUS_INT0_CALLBACK(WRITELINE("ir3", input_merger_device, in_w<1>))
|
||||
MCFG_PC9801CBUS_INT1_CALLBACK(WRITELINE("ir5", input_merger_device, in_w<1>))
|
||||
MCFG_PC9801CBUS_INT2_CALLBACK(WRITELINE("ir6", input_merger_device, in_w<1>))
|
||||
|
Loading…
Reference in New Issue
Block a user