diff options
Diffstat (limited to 'src/mame/drivers/cobra.cpp')
-rw-r--r-- | src/mame/drivers/cobra.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/mame/drivers/cobra.cpp b/src/mame/drivers/cobra.cpp index 44e2e5c605b..5a17fa083a3 100644 --- a/src/mame/drivers/cobra.cpp +++ b/src/mame/drivers/cobra.cpp @@ -494,11 +494,19 @@ private: class cobra_jvs : public jvs_device { public: + template <typename T> + cobra_jvs(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&jvs_host_tag, bool enable) + : cobra_jvs(mconfig, tag, owner, clock) + { + host.set_tag(std::forward<T>(jvs_host_tag)); + set_main_board(enable); + } + cobra_jvs(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); //DECLARE_WRITE_LINE_MEMBER(coin_1_w); //DECLARE_WRITE_LINE_MEMBER(coin_2_w); - static void static_set_main_board(device_t &device, bool enable); + void set_main_board(bool enable) { is_main_board = enable; } void increase_coin_counter(uint8_t which); protected: @@ -524,12 +532,6 @@ cobra_jvs::cobra_jvs(const machine_config &mconfig, const char *tag, device_t *o m_coin_counter[1] = 0; } -void cobra_jvs::static_set_main_board(device_t &device, bool enable) -{ - cobra_jvs &jvsdev = downcast<cobra_jvs &>(device); - jvsdev.is_main_board = enable; -} - #if 0 WRITE_LINE_MEMBER(cobra_jvs::coin_1_w) { @@ -3333,13 +3335,10 @@ MACHINE_CONFIG_START(cobra_state::cobra) m_k001604->set_roz_mem_offset(0); // correct? m_k001604->set_palette(m_palette); - MCFG_DEVICE_ADD(m_jvs_host, COBRA_JVS_HOST, 4000000) - MCFG_JVS_DEVICE_ADD(m_jvs1, COBRA_JVS, "cobra_jvs_host") - cobra_jvs::static_set_main_board(*device, true); - MCFG_JVS_DEVICE_ADD(m_jvs2, COBRA_JVS, "cobra_jvs_host") - cobra_jvs::static_set_main_board(*device, true); - MCFG_JVS_DEVICE_ADD(m_jvs3, COBRA_JVS, "cobra_jvs_host") - cobra_jvs::static_set_main_board(*device, true); + COBRA_JVS_HOST(config, m_jvs_host, 4000000); + COBRA_JVS(config, m_jvs1, 0, m_jvs_host, true); + COBRA_JVS(config, m_jvs2, 0, m_jvs_host, true); + COBRA_JVS(config, m_jvs3, 0, m_jvs_host, true); MACHINE_CONFIG_END /*****************************************************************************/ |