summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/scnxx562.h
diff options
context:
space:
mode:
author wilbertpol <wilbertpol@users.noreply.github.com>2018-03-03 18:18:08 +0100
committer Vas Crabb <cuavas@users.noreply.github.com>2018-03-04 04:18:08 +1100
commit3b923d59ccb8d2d8e386392518450006f8e644fe (patch)
tree73c48568e76d69edbde9f96a3f57d173dd05a747 /src/devices/machine/scnxx562.h
parent25472091b626bd01ef47f11389a4b2ebe0fc0008 (diff)
destaticify initializations (nw) (#3289)
* destaticify initializations (nw) * fix this->set_screen (nw)
Diffstat (limited to 'src/devices/machine/scnxx562.h')
-rw-r--r--src/devices/machine/scnxx562.h69
1 files changed, 34 insertions, 35 deletions
diff --git a/src/devices/machine/scnxx562.h b/src/devices/machine/scnxx562.h
index 2ea72b67b57..160c6d1214c 100644
--- a/src/devices/machine/scnxx562.h
+++ b/src/devices/machine/scnxx562.h
@@ -73,48 +73,48 @@
/* Generic macros */
#define MCFG_DUSCC_OFFSETS(_rxa, _txa, _rxb, _txb) \
- duscc_device::configure_channels(*device, _rxa, _txa, _rxb, _txb);
+ downcast<duscc_device &>(*device).configure_channels(_rxa, _txa, _rxb, _txb);
// Port A callbacks
#define MCFG_DUSCC_OUT_TXDA_CB(_devcb) \
- devcb = &duscc_device::set_out_txda_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<duscc_device &>(*device).set_out_txda_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_DTRA_CB(_devcb) \
- devcb = &duscc_device::set_out_dtra_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<duscc_device &>(*device).set_out_dtra_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_RTSA_CB(_devcb) \
- devcb = &duscc_device::set_out_rtsa_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<duscc_device &>(*device).set_out_rtsa_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_SYNCA_CB(_devcb) \
- devcb = &duscc_device::set_out_synca_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<duscc_device &>(*device).set_out_synca_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_TRXCA_CB(_devcb) \
- devcb = &duscc_device::set_out_trxca_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<duscc_device &>(*device).set_out_trxca_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_RTXCA_CB(_devcb) \
- devcb = &duscc_device::set_out_rtxca_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<duscc_device &>(*device).set_out_rtxca_callback(DEVCB_##_devcb);
// Port B callbacks
#define MCFG_DUSCC_OUT_TXDB_CB(_devcb) \
- devcb = &duscc_device::set_out_txdb_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<duscc_device &>(*device).set_out_txdb_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_DTRB_CB(_devcb) \
- devcb = &duscc_device::set_out_dtrb_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<duscc_device &>(*device).set_out_dtrb_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_RTSB_CB(_devcb) \
- devcb = &duscc_device::set_out_rtsb_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<duscc_device &>(*device).set_out_rtsb_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_SYNCB_CB(_devcb) \
- devcb = &duscc_device::set_out_syncb_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<duscc_device &>(*device).set_out_syncb_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_TRXCB_CB(_devcb) \
- devcb = &duscc_device::set_out_trxcb_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<duscc_device &>(*device).set_out_trxcb_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_RTXCB_CB(_devcb) \
- devcb = &duscc_device::set_out_rtxcb_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<duscc_device &>(*device).set_out_rtxcb_callback(DEVCB_##_devcb);
#define MCFG_DUSCC_OUT_INT_CB(_devcb) \
- devcb = &duscc_device::set_out_int_callback(*device, DEVCB_##_devcb);
+ devcb = &downcast<duscc_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
@@ -607,29 +607,28 @@ public:
// construction/destruction
duscc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> static devcb_base &set_out_txda_callback(device_t &device, Object &&cb) { return downcast<duscc_device &>(device).m_out_txda_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_dtra_callback(device_t &device, Object &&cb) { return downcast<duscc_device &>(device).m_out_dtra_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_rtsa_callback(device_t &device, Object &&cb) { return downcast<duscc_device &>(device).m_out_rtsa_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_synca_callback(device_t &device, Object &&cb) { return downcast<duscc_device &>(device).m_out_synca_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_rtxca_callback(device_t &device, Object &&cb) { return downcast<duscc_device &>(device).m_out_rtxca_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_trxca_callback(device_t &device, Object &&cb) { return downcast<duscc_device &>(device).m_out_trxca_cb.set_callback(std::forward<Object>(cb)); }
-
- template <class Object> static devcb_base &set_out_txdb_callback(device_t &device, Object &&cb) { return downcast<duscc_device &>(device).m_out_txdb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_dtrb_callback(device_t &device, Object &&cb) { return downcast<duscc_device &>(device).m_out_dtrb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_rtsb_callback(device_t &device, Object &&cb) { return downcast<duscc_device &>(device).m_out_rtsb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_syncb_callback(device_t &device, Object &&cb) { return downcast<duscc_device &>(device).m_out_syncb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_rtxcb_callback(device_t &device, Object &&cb) { return downcast<duscc_device &>(device).m_out_rtxcb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_trxcb_callback(device_t &device, Object &&cb) { return downcast<duscc_device &>(device).m_out_trxcb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> static devcb_base &set_out_int_callback(device_t &device, Object &&cb) { return downcast<duscc_device &>(device).m_out_int_cb.set_callback(std::forward<Object>(cb)); }
-
- static void configure_channels(device_t &device, int rxa, int txa, int rxb, int txb)
+ template <class Object> devcb_base &set_out_txda_callback(Object &&cb) { return m_out_txda_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_dtra_callback(Object &&cb) { return m_out_dtra_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_rtsa_callback(Object &&cb) { return m_out_rtsa_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_synca_callback(Object &&cb) { return m_out_synca_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_rtxca_callback(Object &&cb) { return m_out_rtxca_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_trxca_callback(Object &&cb) { return m_out_trxca_cb.set_callback(std::forward<Object>(cb)); }
+
+ template <class Object> devcb_base &set_out_txdb_callback(Object &&cb) { return m_out_txdb_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_dtrb_callback(Object &&cb) { return m_out_dtrb_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_rtsb_callback(Object &&cb) { return m_out_rtsb_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_syncb_callback(Object &&cb) { return m_out_syncb_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_rtxcb_callback(Object &&cb) { return m_out_rtxcb_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_trxcb_callback(Object &&cb) { return m_out_trxcb_cb.set_callback(std::forward<Object>(cb)); }
+ template <class Object> devcb_base &set_out_int_callback(Object &&cb) { return m_out_int_cb.set_callback(std::forward<Object>(cb)); }
+
+ void configure_channels(int rxa, int txa, int rxb, int txb)
{
#if 0 // TODO: Fix this, need a way to set external rx/tx clocks for the channels
- duscc_device &dev = downcast<duscc_device &>(device);
- dev.m_chanA->m_rxc = rxa;
- dev.m_chanA->m_txc = txa;
- dev.m_chanB->m_rxc = rxb;
- dev.m_chanB->m_txc = txb;
+ m_chanA->m_rxc = rxa;
+ m_chanA->m_txc = txa;
+ m_chanB->m_rxc = rxb;
+ m_chanB->m_txc = txb;
#endif
}