summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
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
parent5d5a94e3d7bd1e7b4a3d66f68fb20fc4259480b5 (diff)
ds1315, ds1386, ds2404, ds75160a, ds75161a, eeprom, eepromser, eeprompar: Removed MCFG, nw
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/bus/centronics/epson_lx810l.cpp2
-rw-r--r--src/devices/bus/coco/coco_fdc.cpp3
-rw-r--r--src/devices/bus/cpc/smartwatch.cpp7
-rw-r--r--src/devices/bus/isa/mach32.cpp20
-rw-r--r--src/devices/bus/isa/xtide.cpp2
-rw-r--r--src/devices/bus/sega8/rom.cpp7
-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
-rw-r--r--src/devices/sound/pokey.h4
-rw-r--r--src/devices/video/pc_vga.cpp2
20 files changed, 84 insertions, 273 deletions
diff --git a/src/devices/bus/centronics/epson_lx810l.cpp b/src/devices/bus/centronics/epson_lx810l.cpp
index 0316d5c6dcf..41de6c6b3e7 100644
--- a/src/devices/bus/centronics/epson_lx810l.cpp
+++ b/src/devices/bus/centronics/epson_lx810l.cpp
@@ -156,7 +156,7 @@ MACHINE_CONFIG_START(epson_lx810l_device::device_add_mconfig)
MCFG_E05A30_CENTRONICS_SELECT_CALLBACK(WRITELINE(*this, epson_lx810l_device, e05a30_centronics_select))
/* 256-bit eeprom */
- MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C06_16BIT)
+ EEPROM_93C06_16BIT(config, "eeprom");
STEPPER(config, "pf_stepper", (uint8_t)4);
STEPPER(config, "cr_stepper", (uint8_t)2);
diff --git a/src/devices/bus/coco/coco_fdc.cpp b/src/devices/bus/coco/coco_fdc.cpp
index e1fe7a93d2a..fc5247ab269 100644
--- a/src/devices/bus/coco/coco_fdc.cpp
+++ b/src/devices/bus/coco/coco_fdc.cpp
@@ -141,7 +141,8 @@ MACHINE_CONFIG_START(coco_fdc_device_base::device_add_mconfig)
MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_DEVICE_ADD(DISTO_TAG, MSM6242, 32.768_kHz_XTAL)
- MCFG_DS1315_ADD(CLOUD9_TAG)
+
+ DS1315(config, CLOUD9_TAG, 0);
MACHINE_CONFIG_END
diff --git a/src/devices/bus/cpc/smartwatch.cpp b/src/devices/bus/cpc/smartwatch.cpp
index ec839b6a12b..eef1fb4a14a 100644
--- a/src/devices/bus/cpc/smartwatch.cpp
+++ b/src/devices/bus/cpc/smartwatch.cpp
@@ -19,10 +19,11 @@
DEFINE_DEVICE_TYPE(CPC_SMARTWATCH, cpc_smartwatch_device, "cpc_smartwatch", "Dobbertin Smartwatch")
-MACHINE_CONFIG_START(cpc_smartwatch_device::device_add_mconfig)
- MCFG_DS1315_ADD("rtc")
+void cpc_smartwatch_device::device_add_mconfig(machine_config &config)
+{
+ DS1315(config, m_rtc, 0);
// no pass-through (?)
-MACHINE_CONFIG_END
+}
ROM_START( cpc_smartwatch )
diff --git a/src/devices/bus/isa/mach32.cpp b/src/devices/bus/isa/mach32.cpp
index 8525daf745b..2f686745a5d 100644
--- a/src/devices/bus/isa/mach32.cpp
+++ b/src/devices/bus/isa/mach32.cpp
@@ -47,11 +47,11 @@ mach32_device::mach32_device(const machine_config &mconfig, device_type type, co
{
}
-MACHINE_CONFIG_START(mach32_device::device_add_mconfig)
- MCFG_DEVICE_ADD("8514a", ATIMACH32_8514A, 0)
- downcast<ibm8514a_device*>(device)->set_vga(DEVICE_SELF);
- MCFG_DEVICE_ADD("ati_eeprom", EEPROM_SERIAL_93C56_16BIT)
-MACHINE_CONFIG_END
+void mach32_device::device_add_mconfig(machine_config &config)
+{
+ ATIMACH32_8514A(config, "8514a", 0).set_vga(DEVICE_SELF);
+ EEPROM_93C56_16BIT(config, "ati_eeprom");
+}
void mach32_8514a_device::device_start()
{
@@ -333,11 +333,11 @@ mach64_device::mach64_device(const machine_config &mconfig, device_type type, co
{
}
-MACHINE_CONFIG_START(mach64_device::device_add_mconfig)
- MCFG_DEVICE_ADD("8514a", ATIMACH64_8514A, 0)
- downcast<ibm8514a_device*>(device)->set_vga(DEVICE_SELF);
- MCFG_DEVICE_ADD("ati_eeprom", EEPROM_SERIAL_93C56_16BIT)
-MACHINE_CONFIG_END
+void mach64_device::device_add_mconfig(machine_config &config)
+{
+ ATIMACH64_8514A(config, "8514a", 0).set_vga(DEVICE_SELF);
+ EEPROM_93C56_16BIT(config, "ati_eeprom");
+}
void mach64_8514a_device::device_start()
{
diff --git a/src/devices/bus/isa/xtide.cpp b/src/devices/bus/isa/xtide.cpp
index 756ebd188f9..1388a7d174b 100644
--- a/src/devices/bus/isa/xtide.cpp
+++ b/src/devices/bus/isa/xtide.cpp
@@ -267,7 +267,7 @@ void xtide_device::device_add_mconfig(machine_config &config)
ATA_INTERFACE(config, m_ata).options(ata_devices, "hdd", nullptr, false);
m_ata->irq_handler().set(FUNC(xtide_device::ide_interrupt));
- EEPROM_PARALLEL_2864(config, m_eeprom);
+ EEPROM_2864(config, m_eeprom);
}
//-------------------------------------------------
diff --git a/src/devices/bus/sega8/rom.cpp b/src/devices/bus/sega8/rom.cpp
index 19981c55b56..72017b5c795 100644
--- a/src/devices/bus/sega8/rom.cpp
+++ b/src/devices/bus/sega8/rom.cpp
@@ -714,9 +714,10 @@ WRITE8_MEMBER(sega8_eeprom_device::write_mapper)
}
}
-MACHINE_CONFIG_START(sega8_eeprom_device::device_add_mconfig)
- MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT)
-MACHINE_CONFIG_END
+void sega8_eeprom_device::device_add_mconfig(machine_config &config)
+{
+ EEPROM_93C46_16BIT(config, "eeprom");
+}
/*-------------------------------------------------
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
diff --git a/src/devices/sound/pokey.h b/src/devices/sound/pokey.h
index 10faf22c8da..edcf760f756 100644
--- a/src/devices/sound/pokey.h
+++ b/src/devices/sound/pokey.h
@@ -214,6 +214,10 @@ public:
template <class Object> devcb_base &set_allpot_r_callback(Object &&cb) { return m_allpot_r_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_serin_r_callback(Object &&cb) { return m_serin_r_cb.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_serout_w_callback(Object &&cb) { return m_serout_w_cb.set_callback(std::forward<Object>(cb)); }
+ template <unsigned N> auto pot_r() { return m_pot_r_cb[N].bind(); }
+ auto allpot_r() { return m_allpot_r_cb.bind(); }
+ auto serin_r() { return m_serin_r_cb.bind(); }
+ auto serout_w() { return m_serout_w_cb.bind(); }
template <typename Object> void set_keyboard_callback(Object &&cb) { m_keyboard_r = std::forward<Object>(cb); }
template <typename Object> void set_interrupt_callback(Object &&cb) { m_irq_f = std::forward<Object>(cb); }
diff --git a/src/devices/video/pc_vga.cpp b/src/devices/video/pc_vga.cpp
index 78575c56e7d..1040c0da789 100644
--- a/src/devices/video/pc_vga.cpp
+++ b/src/devices/video/pc_vga.cpp
@@ -2222,7 +2222,7 @@ WRITE8_MEMBER(vga_device::mem_linear_w)
MACHINE_CONFIG_START(ati_vga_device::device_add_mconfig)
MCFG_MACH8_ADD_OWNER("8514a")
- MCFG_DEVICE_ADD("ati_eeprom", EEPROM_SERIAL_93C46_16BIT)
+ EEPROM_93C46_16BIT(config, "ati_eeprom");
MACHINE_CONFIG_END
MACHINE_CONFIG_START(s3_vga_device::device_add_mconfig)