diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2018-06-03 20:56:28 -0400 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2018-06-03 20:56:28 -0400 |
commit | ad905451e1c578355df1696b55ce0b7de49e04c8 (patch) | |
tree | 531145ab40f15d8467a9e6d068aa32f2922f44fc | |
parent | 7beb9eb6f2706636743807ffce97290f96c3b4e4 (diff) |
pc9801_cbus: Replace hard-coded CPU tag with configuration macro (nw)
-rw-r--r-- | src/devices/bus/cbus/pc9801_cbus.cpp | 2 | ||||
-rw-r--r-- | src/devices/bus/cbus/pc9801_cbus.h | 4 | ||||
-rw-r--r-- | src/mame/drivers/pc9801.cpp | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/devices/bus/cbus/pc9801_cbus.cpp b/src/devices/bus/cbus/pc9801_cbus.cpp index 528dd86ce43..eb62af6daaa 100644 --- a/src/devices/bus/cbus/pc9801_cbus.cpp +++ b/src/devices/bus/cbus/pc9801_cbus.cpp @@ -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}} { } diff --git a/src/devices/bus/cbus/pc9801_cbus.h b/src/devices/bus/cbus/pc9801_cbus.h index 5508e1297d8..9f2f72591fb 100644 --- a/src/devices/bus/cbus/pc9801_cbus.h +++ b/src/devices/bus/cbus/pc9801_cbus.h @@ -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); } diff --git a/src/mame/drivers/pc9801.cpp b/src/mame/drivers/pc9801.cpp index e34e11a086d..df2e8c8c534 100644 --- a/src/mame/drivers/pc9801.cpp +++ b/src/mame/drivers/pc9801.cpp @@ -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>)) |