summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine
diff options
context:
space:
mode:
author mooglyguy <therealmogminer@gmail.com>2018-08-23 18:34:05 +0200
committer mooglyguy <therealmogminer@gmail.com>2018-08-23 18:34:21 +0200
commitf10c6be54ff10fe557388f4e1d7fe3b648782b21 (patch)
tree24c452f1943990bbb683220b4b71315a89e7926f /src/devices/machine
parent5d5a94e3d7bd1e7b4a3d66f68fb20fc4259480b5 (diff)
ds1315, ds1386, ds2404, ds75160a, ds75161a, eeprom, eepromser, eeprompar: Removed MCFG, nw
Diffstat (limited to 'src/devices/machine')
-rw-r--r--src/devices/machine/ds1315.h18
-rw-r--r--src/devices/machine/ds1386.h25
-rw-r--r--src/devices/machine/ds2404.h32
-rw-r--r--src/devices/machine/ds75160a.h6
-rw-r--r--src/devices/machine/ds75161a.h95
-rw-r--r--src/devices/machine/eeprom.cpp10
-rw-r--r--src/devices/machine/eeprom.h44
-rw-r--r--src/devices/machine/eeprompar.cpp6
-rw-r--r--src/devices/machine/eeprompar.h43
-rw-r--r--src/devices/machine/eepromser.cpp10
-rw-r--r--src/devices/machine/eepromser.h15
-rw-r--r--src/devices/machine/latch8.h6
12 files changed, 57 insertions, 253 deletions
diff --git a/src/devices/machine/ds1315.h b/src/devices/machine/ds1315.h
index 21a7f37c14f..a5b70c38c76 100644
--- a/src/devices/machine/ds1315.h
+++ b/src/devices/machine/ds1315.h
@@ -15,26 +15,14 @@
#pragma once
-/***************************************************************************
- DEVICE CONFIGURATION MACROS
-***************************************************************************/
-
-#define MCFG_DS1315_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, DS1315, 0)
-
-#define MCFG_DS1315_BACKING_HANDLER(_devcb) \
- downcast<ds1315_device &>(*device).set_backing_handler(DEVCB_##_devcb);
-
-/***************************************************************************
- MACROS
-***************************************************************************/
-
class ds1315_device : public device_t
{
public:
ds1315_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~ds1315_device() {}
+ auto read_backing() { return m_backing_read.bind(); }
+
// this handler automates the bits 0/2 stuff
DECLARE_READ8_MEMBER(read);
@@ -46,8 +34,6 @@ public:
bool chip_enable();
void chip_reset();
- template <class Object> devcb_base &set_backing_handler(Object &&cb) { return m_backing_read.set_callback(std::forward<Object>(cb)); }
-
protected:
// device-level overrides
virtual void device_start() override;
diff --git a/src/devices/machine/ds1386.h b/src/devices/machine/ds1386.h
index 5188cf949b9..eed7463b3ac 100644
--- a/src/devices/machine/ds1386.h
+++ b/src/devices/machine/ds1386.h
@@ -56,24 +56,14 @@
#pragma once
-
-// handlers
-
-#define MCFG_DS1386_INTA_HANDLER(_devcb) \
- downcast<ds1386_device &>(*device).set_inta_cb(DEVCB_##_devcb);
-
-#define MCFG_DS1386_INTB_HANDLER(_devcb) \
- downcast<ds1386_device &>(*device).set_intb_cb(DEVCB_##_devcb);
-
-#define MCFG_DS1386_SQW_HANDLER(_devcb) \
- downcast<ds1386_device &>(*device).set_sqw_cb(DEVCB_##_devcb);
-
-// devices
-
class ds1386_device : public device_t,
public device_nvram_interface
{
public:
+ auto inta() { return m_inta_cb.bind(); }
+ auto intb() { return m_intb_cb.bind(); }
+ auto sqw() { return m_sqw_cb.bind(); }
+
DECLARE_WRITE8_MEMBER( data_w );
DECLARE_READ8_MEMBER( data_r );
@@ -81,10 +71,6 @@ public:
DECLARE_WRITE_LINE_MEMBER( oe_w );
DECLARE_WRITE_LINE_MEMBER( we_w );
- template <class Object> devcb_base &set_inta_cb(Object &&cb) { return m_inta_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_intb_cb(Object &&cb) { return m_intb_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_sqw_cb(Object &&cb) { return m_sqw_cb.set_callback(std::forward<Object>(cb)); }
-
protected:
enum
{
@@ -185,18 +171,15 @@ protected:
class ds1386_8k_device : public ds1386_device
{
public:
- // construction/destruction
ds1386_8k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
class ds1386_32k_device : public ds1386_device
{
public:
- // construction/destruction
ds1386_32k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
-// device type definition
DECLARE_DEVICE_TYPE(DS1386_8K, ds1386_8k_device)
DECLARE_DEVICE_TYPE(DS1386_32K, ds1386_32k_device)
diff --git a/src/devices/machine/ds2404.h b/src/devices/machine/ds2404.h
index 9eefcae0e94..3b7442512a4 100644
--- a/src/devices/machine/ds2404.h
+++ b/src/devices/machine/ds2404.h
@@ -13,30 +13,6 @@
#pragma once
-
-
-
-/***************************************************************************
- DEVICE CONFIGURATION MACROS
-***************************************************************************/
-
-#define MCFG_DS2404_REF_YEAR(_ref_year) \
- downcast<ds2404_device &>(*device).set_ref_year(_ref_year);
-
-#define MCFG_DS2404_REF_MONTH(_ref_month) \
- downcast<ds2404_device &>(*device).set_ref_month(_ref_month);
-
-#define MCFG_DS2404_REF_DAY(_ref_day) \
- downcast<ds2404_device &>(*device).set_ref_day(_ref_day);
-
-
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
-
-
-// ======================> ds2404_device
-
class ds2404_device : public device_t, public device_nvram_interface
{
public:
@@ -44,9 +20,9 @@ public:
ds2404_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration helpers
- void set_ref_year(uint32_t year) { m_ref_year = year; }
- void set_ref_month(uint8_t month) { m_ref_month = month; }
- void set_ref_day(uint8_t day) { m_ref_day = day; }
+ void ref_year(uint32_t year) { m_ref_year = year; }
+ void ref_month(uint8_t month) { m_ref_month = month; }
+ void ref_day(uint8_t day) { m_ref_day = day; }
/* 1-wire interface reset */
DECLARE_WRITE8_MEMBER(ds2404_1w_reset_w);
@@ -112,8 +88,6 @@ private:
int m_state_ptr;
};
-
-// device type definition
DECLARE_DEVICE_TYPE(DS2404, ds2404_device)
#endif // MAME_MACHINE_DS2404_H
diff --git a/src/devices/machine/ds75160a.h b/src/devices/machine/ds75160a.h
index 85ee2727809..2f2a2147a5e 100644
--- a/src/devices/machine/ds75160a.h
+++ b/src/devices/machine/ds75160a.h
@@ -49,10 +49,8 @@ public:
// construction/destruction
ds75160a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Read, class Write> void set_callbacks(Read &&rd, Write &&wr) {
- m_read.set_callback(std::forward<Read>(rd));
- m_write.set_callback(std::forward<Write>(wr));
- }
+ auto read_callback() { return m_read.bind(); }
+ auto write_callback() { return m_write.bind(); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
diff --git a/src/devices/machine/ds75161a.h b/src/devices/machine/ds75161a.h
index 58d257a27ae..8ea0a0b9632 100644
--- a/src/devices/machine/ds75161a.h
+++ b/src/devices/machine/ds75161a.h
@@ -24,89 +24,28 @@
#pragma once
-
-
-
-///*************************************************************************
-// INTERFACE CONFIGURATION MACROS
-///*************************************************************************
-
-#define MCFG_DS75161A_IN_REN_CB(_devcb) \
- downcast<ds75161a_device &>(*device).set_in_ren_callback(DEVCB_##_devcb);
-
-#define MCFG_DS75161A_IN_IFC_CB(_devcb) \
- downcast<ds75161a_device &>(*device).set_in_ifc_callback(DEVCB_##_devcb);
-
-#define MCFG_DS75161A_IN_NDAC_CB(_devcb) \
- downcast<ds75161a_device &>(*device).set_in_ndac_callback(DEVCB_##_devcb);
-
-#define MCFG_DS75161A_IN_NRFD_CB(_devcb) \
- downcast<ds75161a_device &>(*device).set_in_nrfd_callback(DEVCB_##_devcb);
-
-#define MCFG_DS75161A_IN_DAV_CB(_devcb) \
- downcast<ds75161a_device &>(*device).set_in_dav_callback(DEVCB_##_devcb);
-
-#define MCFG_DS75161A_IN_EOI_CB(_devcb) \
- downcast<ds75161a_device &>(*device).set_in_eoi_callback(DEVCB_##_devcb);
-
-#define MCFG_DS75161A_IN_ATN_CB(_devcb) \
- downcast<ds75161a_device &>(*device).set_in_atn_callback(DEVCB_##_devcb);
-
-#define MCFG_DS75161A_IN_SRQ_CB(_devcb) \
- downcast<ds75161a_device &>(*device).set_in_srq_callback(DEVCB_##_devcb);
-
-#define MCFG_DS75161A_OUT_REN_CB(_devcb) \
- downcast<ds75161a_device &>(*device).set_out_ren_callback(DEVCB_##_devcb);
-
-#define MCFG_DS75161A_OUT_IFC_CB(_devcb) \
- downcast<ds75161a_device &>(*device).set_out_ifc_callback(DEVCB_##_devcb);
-
-#define MCFG_DS75161A_OUT_NDAC_CB(_devcb) \
- downcast<ds75161a_device &>(*device).set_out_ndac_callback(DEVCB_##_devcb);
-
-#define MCFG_DS75161A_OUT_NRFD_CB(_devcb) \
- downcast<ds75161a_device &>(*device).set_out_nrfd_callback(DEVCB_##_devcb);
-
-#define MCFG_DS75161A_OUT_DAV_CB(_devcb) \
- downcast<ds75161a_device &>(*device).set_out_dav_callback(DEVCB_##_devcb);
-
-#define MCFG_DS75161A_OUT_EOI_CB(_devcb) \
- downcast<ds75161a_device &>(*device).set_out_eoi_callback(DEVCB_##_devcb);
-
-#define MCFG_DS75161A_OUT_ATN_CB(_devcb) \
- downcast<ds75161a_device &>(*device).set_out_atn_callback(DEVCB_##_devcb);
-
-#define MCFG_DS75161A_OUT_SRQ_CB(_devcb) \
- downcast<ds75161a_device &>(*device).set_out_srq_callback(DEVCB_##_devcb);
-
-///*************************************************************************
-// TYPE DEFINITIONS
-///*************************************************************************
-
-// ======================> ds75161a_device
-
class ds75161a_device : public device_t
{
public:
// construction/destruction
ds75161a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- template <class Object> devcb_base &set_in_ren_callback(Object &&cb) { return m_in_ren_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_ifc_callback(Object &&cb) { return m_in_ifc_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_ndac_callback(Object &&cb) { return m_in_ndac_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_nrfd_callback(Object &&cb) { return m_in_nrfd_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_dav_callback(Object &&cb) { return m_in_dav_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_eoi_callback(Object &&cb) { return m_in_eoi_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_atn_callback(Object &&cb) { return m_in_atn_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_in_srq_callback(Object &&cb) { return m_in_srq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_ren_callback(Object &&cb) { return m_out_ren_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_ifc_callback(Object &&cb) { return m_out_ifc_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_ndac_callback(Object &&cb) { return m_out_ndac_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_nrfd_callback(Object &&cb) { return m_out_nrfd_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_dav_callback(Object &&cb) { return m_out_dav_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_eoi_callback(Object &&cb) { return m_out_eoi_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_atn_callback(Object &&cb) { return m_out_atn_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_srq_callback(Object &&cb) { return m_out_srq_cb.set_callback(std::forward<Object>(cb)); }
+ auto in_ren() { return m_in_ren_cb.bind(); }
+ auto in_ifc() { return m_in_ifc_cb.bind(); }
+ auto in_ndac() { return m_in_ndac_cb.bind(); }
+ auto in_nrfd() { return m_in_nrfd_cb.bind(); }
+ auto in_dav() { return m_in_dav_cb.bind(); }
+ auto in_eoi() { return m_in_eoi_cb.bind(); }
+ auto in_atn() { return m_in_atn_cb.bind(); }
+ auto in_srq() { return m_in_srq_cb.bind(); }
+ auto out_ren() { return m_out_ren_cb.bind(); }
+ auto out_ifc() { return m_out_ifc_cb.bind(); }
+ auto out_ndac() { return m_out_ndac_cb.bind(); }
+ auto out_nrfd() { return m_out_nrfd_cb.bind(); }
+ auto out_dav() { return m_out_dav_cb.bind(); }
+ auto out_eoi() { return m_out_eoi_cb.bind(); }
+ auto out_atn() { return m_out_atn_cb.bind(); }
+ auto out_srq() { return m_out_srq_cb.bind(); }
DECLARE_WRITE_LINE_MEMBER( te_w );
DECLARE_WRITE_LINE_MEMBER( dc_w );
@@ -167,8 +106,6 @@ private:
int m_dc;
};
-
-// device type definition
DECLARE_DEVICE_TYPE(DS75161A, ds75161a_device)
#endif // MAME_MACHINE_DS75161A_H
diff --git a/src/devices/machine/eeprom.cpp b/src/devices/machine/eeprom.cpp
index 86e6c749ff1..0c81a6701e0 100644
--- a/src/devices/machine/eeprom.cpp
+++ b/src/devices/machine/eeprom.cpp
@@ -49,7 +49,7 @@ eeprom_base_device::eeprom_base_device(const machine_config &mconfig, device_typ
// to set the default data
//-------------------------------------------------
-void eeprom_base_device::set_size(int cells, int cellbits)
+eeprom_base_device& eeprom_base_device::size(int cells, int cellbits)
{
m_cells = cells;
m_data_bits = cellbits;
@@ -62,6 +62,8 @@ void eeprom_base_device::set_size(int cells, int cellbits)
cells >>= 1;
m_address_bits++;
}
+
+ return *this;
}
@@ -70,18 +72,20 @@ void eeprom_base_device::set_size(int cells, int cellbits)
// to set the default data
//-------------------------------------------------
-void eeprom_base_device::set_default_data(const uint8_t *data, uint32_t size)
+eeprom_base_device& eeprom_base_device::default_data(const uint8_t *data, uint32_t size)
{
assert(m_data_bits == 8);
m_default_data = data;
m_default_data_size = size;
+ return *this;
}
-void eeprom_base_device::set_default_data(const uint16_t *data, uint32_t size)
+eeprom_base_device& eeprom_base_device::default_data(const uint16_t *data, uint32_t size)
{
assert(m_data_bits == 16);
m_default_data = data;
m_default_data_size = size / 2;
+ return *this;
}
diff --git a/src/devices/machine/eeprom.h b/src/devices/machine/eeprom.h
index 0cf280d6441..eb0a64b9234 100644
--- a/src/devices/machine/eeprom.h
+++ b/src/devices/machine/eeprom.h
@@ -13,36 +13,6 @@
#pragma once
-
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_EEPROM_SIZE(_cells, _cellbits) \
- downcast<eeprom_base_device &>(*device).set_size(_cells, _cellbits);
-#define MCFG_EEPROM_DATA(_data, _size) \
- downcast<eeprom_base_device &>(*device).set_default_data(_data, _size);
-#define MCFG_EEPROM_DEFAULT_VALUE(_value) \
- downcast<eeprom_base_device &>(*device).set_default_value(_value);
-
-#define MCFG_EEPROM_WRITE_TIME(_value) \
- downcast<eeprom_base_device &>(*device).set_timing(eeprom_base_device::WRITE_TIME, _value);
-#define MCFG_EEPROM_WRITE_ALL_TIME(_value) \
- downcast<eeprom_base_device &>(*device).set_timing(eeprom_base_device::WRITE_ALL_TIME, _value);
-#define MCFG_EEPROM_ERASE_TIME(_value) \
- downcast<eeprom_base_device &>(*device).set_timing(eeprom_base_device::ERASE_TIME, _value);
-#define MCFG_EEPROM_ERASE_ALL_TIME(_value) \
- downcast<eeprom_base_device &>(*device).set_timing(eeprom_base_device::ERASE_ALL_TIME, _value);
-
-
-
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
-
-// ======================> eeprom_base_device
-
class eeprom_base_device : public device_t,
public device_nvram_interface
{
@@ -58,11 +28,15 @@ public:
};
// inline configuration helpers
- void set_size(int cells, int cellbits);
- void set_default_data(const uint8_t *data, uint32_t size);
- void set_default_data(const uint16_t *data, uint32_t size);
- void set_default_value(uint32_t value) { m_default_value = value; m_default_value_set = true; }
- void set_timing(timing_type type, const attotime &duration) { m_operation_time[type] = duration; }
+ eeprom_base_device& size(int cells, int cellbits);
+ eeprom_base_device& default_data(const uint8_t *data, uint32_t size);
+ eeprom_base_device& default_data(const uint16_t *data, uint32_t size);
+ eeprom_base_device& default_value(uint32_t value) { m_default_value = value; m_default_value_set = true; return *this; }
+ eeprom_base_device& timing(timing_type type, const attotime &duration) { m_operation_time[type] = duration; return *this; }
+ eeprom_base_device& write_time(const attotime &duration) { m_operation_time[eeprom_base_device::WRITE_TIME] = duration; return *this; }
+ eeprom_base_device& write_all_time(const attotime &duration) { m_operation_time[eeprom_base_device::WRITE_ALL_TIME] = duration; return *this; }
+ eeprom_base_device& erase_time(const attotime &duration) { m_operation_time[eeprom_base_device::ERASE_TIME] = duration; return *this; }
+ eeprom_base_device& erase_all_time(const attotime &duration) { m_operation_time[eeprom_base_device::ERASE_ALL_TIME] = duration; return *this; }
// read/write/erase data
uint32_t read(offs_t address);
diff --git a/src/devices/machine/eeprompar.cpp b/src/devices/machine/eeprompar.cpp
index 3be7298afc7..f0b4f595a25 100644
--- a/src/devices/machine/eeprompar.cpp
+++ b/src/devices/machine/eeprompar.cpp
@@ -204,11 +204,11 @@ WRITE32_MEMBER(eeprom_parallel_28xx_device::unlock_write32) { oe_w(1); }
// macro for defining a new device class
#define DEFINE_PARALLEL_EEPROM_DEVICE(_baseclass, _lowercase, _uppercase, _bits, _cells) \
eeprom_parallel_##_lowercase##_device::eeprom_parallel_##_lowercase##_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) \
- : eeprom_parallel_##_baseclass##_device(mconfig, EEPROM_PARALLEL_##_uppercase, tag, owner) \
+ : eeprom_parallel_##_baseclass##_device(mconfig, EEPROM_##_uppercase, tag, owner) \
{ \
- set_size(_cells, _bits); \
+ size(_cells, _bits); \
} \
-DEFINE_DEVICE_TYPE(EEPROM_PARALLEL_##_uppercase, eeprom_parallel_##_lowercase##_device, #_lowercase, "Parallel EEPROM " #_uppercase " (" #_cells "x" #_bits ")")
+DEFINE_DEVICE_TYPE(EEPROM_##_uppercase, eeprom_parallel_##_lowercase##_device, #_lowercase, "Parallel EEPROM " #_uppercase " (" #_cells "x" #_bits ")")
// standard 28XX class of 8-bit EEPROMs
DEFINE_PARALLEL_EEPROM_DEVICE(28xx, 2804, 2804, 8, 512)
diff --git a/src/devices/machine/eeprompar.h b/src/devices/machine/eeprompar.h
index 75651850d22..efee449e1b8 100644
--- a/src/devices/machine/eeprompar.h
+++ b/src/devices/machine/eeprompar.h
@@ -15,41 +15,6 @@
#include "eeprom.h"
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-// standard 28XX class of 8-bit parallel EEPROMs
-#define MCFG_EEPROM_2804_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, EEPROM_PARALLEL_2804, 0)
-#define MCFG_EEPROM_2816_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, EEPROM_PARALLEL_2816, 0)
-#define MCFG_EEPROM_2864_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, EEPROM_PARALLEL_2864, 0)
-#define MCFG_EEPROM_28256_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, EEPROM_PARALLEL_28256, 0)
-#define MCFG_EEPROM_28512_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, EEPROM_PARALLEL_28512, 0)
-#define MCFG_EEPROM_28010_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, EEPROM_PARALLEL_28010, 0)
-#define MCFG_EEPROM_28020_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, EEPROM_PARALLEL_28020, 0)
-#define MCFG_EEPROM_28040_ADD(_tag) \
- MCFG_DEVICE_ADD(_tag, EEPROM_PARALLEL_28040, 0)
-
-// true when external circuit is used to lock EEPROM after every write
-#define MCFG_EEPROM_28XX_LOCK_AFTER_WRITE(_lock) \
- downcast<eeprom_parallel_28xx_device &>(*device).set_lock_after_write(_lock);
-
-
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
-
-
-// ======================> eeprom_parallel_base_device
-
class eeprom_parallel_base_device : public eeprom_base_device
{
protected:
@@ -61,15 +26,11 @@ protected:
virtual void device_reset() override;
};
-
-
-// ======================> eeprom_parallel_28xx_device
-
class eeprom_parallel_28xx_device : public eeprom_parallel_base_device
{
public:
// configuration helpers
- void set_lock_after_write(bool lock) { m_lock_after_write = lock; }
+ void lock_after_write(bool lock) { m_lock_after_write = lock; }
// read/write data lines
DECLARE_WRITE8_MEMBER(write);
@@ -110,7 +71,7 @@ class eeprom_parallel_##_lowercase##_device : public eeprom_parallel_##_baseclas
public: \
eeprom_parallel_##_lowercase##_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); \
}; \
-DECLARE_DEVICE_TYPE(EEPROM_PARALLEL_##_uppercase, eeprom_parallel_##_lowercase##_device)
+DECLARE_DEVICE_TYPE(EEPROM_##_uppercase, eeprom_parallel_##_lowercase##_device)
// standard 28XX class of 8-bit EEPROMs
DECLARE_PARALLEL_EEPROM_DEVICE(28xx, 2804, 2804)
diff --git a/src/devices/machine/eepromser.cpp b/src/devices/machine/eepromser.cpp
index 2058a22963c..74acf0a17dc 100644
--- a/src/devices/machine/eepromser.cpp
+++ b/src/devices/machine/eepromser.cpp
@@ -1099,18 +1099,18 @@ WRITE_LINE_MEMBER(eeprom_serial_x24c44_device::di_write) { base_di_write(state);
// macro for defining a new device class
#define DEFINE_SERIAL_EEPROM_DEVICE(_baseclass, _lowercase, _uppercase, _bits, _cells, _addrbits) \
eeprom_serial_##_lowercase##_##_bits##bit_device::eeprom_serial_##_lowercase##_##_bits##bit_device(const machine_config &mconfig, const char *tag, device_t *owner, eeprom_serial_streaming enable_streaming) \
- : eeprom_serial_##_baseclass##_device(mconfig, EEPROM_SERIAL_##_uppercase##_##_bits##BIT, tag, owner, enable_streaming) \
+ : eeprom_serial_##_baseclass##_device(mconfig, EEPROM_##_uppercase##_##_bits##BIT, tag, owner, enable_streaming) \
{ \
- set_size(_cells, _bits); \
+ size(_cells, _bits); \
set_address_bits(_addrbits); \
} \
eeprom_serial_##_lowercase##_##_bits##bit_device::eeprom_serial_##_lowercase##_##_bits##bit_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) \
- : eeprom_serial_##_baseclass##_device(mconfig, EEPROM_SERIAL_##_uppercase##_##_bits##BIT, tag, owner, eeprom_serial_streaming::DISABLE) \
+ : eeprom_serial_##_baseclass##_device(mconfig, EEPROM_##_uppercase##_##_bits##BIT, tag, owner, eeprom_serial_streaming::DISABLE) \
{ \
- set_size(_cells, _bits); \
+ size(_cells, _bits); \
set_address_bits(_addrbits); \
} \
-DEFINE_DEVICE_TYPE(EEPROM_SERIAL_##_uppercase##_##_bits##BIT, eeprom_serial_##_lowercase##_##_bits##bit_device, #_lowercase "_" #_bits, "Serial EEPROM " #_uppercase " (" #_cells "x" #_bits ")")
+DEFINE_DEVICE_TYPE(EEPROM_##_uppercase##_##_bits##BIT, eeprom_serial_##_lowercase##_##_bits##bit_device, #_lowercase "_" #_bits, "Serial EEPROM " #_uppercase " (" #_cells "x" #_bits ")")
// standard 93CX6 class of 16-bit EEPROMs
DEFINE_SERIAL_EEPROM_DEVICE(93cxx, 93c06, 93C06, 16, 16, 6)
diff --git a/src/devices/machine/eepromser.h b/src/devices/machine/eepromser.h
index c4a83365e26..4ff8634ce02 100644
--- a/src/devices/machine/eepromser.h
+++ b/src/devices/machine/eepromser.h
@@ -15,19 +15,6 @@
#include "eeprom.h"
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_EEPROM_SERIAL_DO_CALLBACK(_devcb) \
- downcast<eeprom_serial_base_device &>(*device).set_do_callback(DEVCB_##_devcb);
-
-
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
-
enum class eeprom_serial_streaming : bool
{
DISABLE = false,
@@ -233,7 +220,7 @@ public: \
eeprom_serial_##_lowercase##_##_bits##bit_device(const machine_config &mconfig, const char *tag, device_t *owner, eeprom_serial_streaming enable_streaming = eeprom_serial_streaming::DISABLE); \
eeprom_serial_##_lowercase##_##_bits##bit_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); \
}; \
-DECLARE_DEVICE_TYPE(EEPROM_SERIAL_##_uppercase##_##_bits##BIT, eeprom_serial_##_lowercase##_##_bits##bit_device)
+DECLARE_DEVICE_TYPE(EEPROM_##_uppercase##_##_bits##BIT, eeprom_serial_##_lowercase##_##_bits##bit_device)
// standard 93CX6 class of 16-bit EEPROMs
DECLARE_SERIAL_EEPROM_DEVICE(93cxx, 93c06, 93C06, 16)
diff --git a/src/devices/machine/latch8.h b/src/devices/machine/latch8.h
index 44644c5952c..ee00fbdc38d 100644
--- a/src/devices/machine/latch8.h
+++ b/src/devices/machine/latch8.h
@@ -26,8 +26,7 @@
class latch8_device : public device_t
{
public:
- latch8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
+ latch8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
/* write & read full byte */
@@ -79,8 +78,9 @@ public:
void set_nosync(uint32_t nosync) { m_nosync = nosync; }
template <unsigned N, class Object> devcb_base &set_write_cb(Object &&cb) { return m_write_cb[N].set_callback(std::forward<Object>(cb)); }
-
template <unsigned N, class Object> devcb_base &set_read_cb(Object &&cb) { return m_read_cb[N].set_callback(std::forward<Object>(cb)); }
+ template <unsigned N> auto write_cb() { return m_write_cb[N].bind(); }
+ template <unsigned N> auto read_cb() { return m_read_cb[N].bind(); }
protected:
// device-level overrides