summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/devices/machine/eepromser.cpp45
-rw-r--r--src/devices/machine/eepromser.h25
-rw-r--r--src/mame/drivers/cave.cpp6
-rw-r--r--src/mame/drivers/gaelco3d.cpp2
-rw-r--r--src/mame/drivers/leland.cpp2
-rw-r--r--src/mame/drivers/tecmosys.cpp2
-rw-r--r--src/mame/drivers/tmmjprd.cpp2
7 files changed, 31 insertions, 53 deletions
diff --git a/src/devices/machine/eepromser.cpp b/src/devices/machine/eepromser.cpp
index 99778e47e76..e3c8cca4513 100644
--- a/src/devices/machine/eepromser.cpp
+++ b/src/devices/machine/eepromser.cpp
@@ -155,10 +155,10 @@ ALLOW_SAVE_TYPE(eeprom_serial_base_device::eeprom_state);
// eeprom_serial_base_device - constructor
//-------------------------------------------------
-eeprom_serial_base_device::eeprom_serial_base_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, bool enable_streaming)
+eeprom_serial_base_device::eeprom_serial_base_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, eeprom_serial_streaming enable_streaming)
: eeprom_base_device(mconfig, devtype, tag, owner),
m_command_address_bits(0),
- m_streaming_enabled(enable_streaming),
+ m_streaming_enabled(bool(enable_streaming)),
m_output_on_falling_clock_enabled(false),
m_do_cb(*this),
m_state(STATE_IN_RESET),
@@ -621,16 +621,12 @@ void eeprom_serial_base_device::execute_write_command()
// STANDARD INTERFACE IMPLEMENTATION
//**************************************************************************
-//-------------------------------------------------
-// eeprom_serial_93cxx_device - constructor
-//-------------------------------------------------
-
-eeprom_serial_93cxx_device::eeprom_serial_93cxx_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, bool enable_streaming)
- : eeprom_serial_base_device(mconfig, devtype, tag, owner, enable_streaming)
+eeprom_serial_s29x90_device::eeprom_serial_s29x90_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, eeprom_serial_streaming ignored);
+ : eeprom_serial_93cxx_device(mconfig, devtype, tag, owner, eeprom_serial_streaming::ENABLE)
{
+ enable_output_on_falling_clock(true);
}
-
//-------------------------------------------------
// parse_command_and_address - extract the
// command and address from a bitstream
@@ -689,16 +685,6 @@ WRITE_LINE_MEMBER(eeprom_serial_93cxx_device::di_write) { base_di_write(state);
//**************************************************************************
//-------------------------------------------------
-// eeprom_serial_er5911_device - constructor
-//-------------------------------------------------
-
-eeprom_serial_er5911_device::eeprom_serial_er5911_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, bool enable_streaming)
- : eeprom_serial_base_device(mconfig, devtype, tag, owner, enable_streaming)
-{
-}
-
-
-//-------------------------------------------------
// parse_command_and_address - extract the
// command and address from a bitstream
//-------------------------------------------------
@@ -757,17 +743,6 @@ WRITE_LINE_MEMBER(eeprom_serial_er5911_device::di_write) { base_di_write(state);
//**************************************************************************
//-------------------------------------------------
-// eeprom_serial_x24c44_device - constructor
-//-------------------------------------------------
-
-eeprom_serial_x24c44_device::eeprom_serial_x24c44_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, bool enable_streaming)
- : eeprom_serial_base_device(mconfig, devtype, tag, owner, enable_streaming)
-{
-}
-
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -1123,8 +1098,14 @@ 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, bool enable_streaming) \
- : eeprom_serial_##_baseclass##_device(mconfig, EEPROM_SERIAL_##_uppercase##_##_bits##BIT, tag, owner, (bool)enable_streaming) \
+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) \
+{ \
+ set_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) \
{ \
set_size(_cells, _bits); \
set_address_bits(_addrbits); \
diff --git a/src/devices/machine/eepromser.h b/src/devices/machine/eepromser.h
index 0e5a299ecb1..c68276da19a 100644
--- a/src/devices/machine/eepromser.h
+++ b/src/devices/machine/eepromser.h
@@ -28,10 +28,10 @@
// TYPE DEFINITIONS
//**************************************************************************
-enum : bool
+enum class eeprom_serial_streaming : bool
{
- EEPROM_SERIAL_NO_STREAMING = false,
- EEPROM_SERIAL_ENABLE_STREAMING = true
+ DISABLE = false,
+ ENABLE = true
};
// ======================> eeprom_serial_base_device
@@ -40,14 +40,13 @@ class eeprom_serial_base_device : public eeprom_base_device
{
public:
// inline configuration helpers
- void set_address_bits(int addrbits) { m_command_address_bits = addrbits; }
void enable_streaming(bool enable) { m_streaming_enabled = enable; }
void enable_output_on_falling_clock(bool enable) { m_output_on_falling_clock_enabled = enable; }
template<class Object> devcb_base &set_do_callback(Object &&cb) { return m_do_cb.set_callback(std::forward<Object>(cb)); }
protected:
// construction/destruction
- eeprom_serial_base_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, bool enable_streaming = EEPROM_SERIAL_NO_STREAMING);
+ eeprom_serial_base_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, eeprom_serial_streaming enable_streaming);
// device-level overrides
virtual void device_start() override;
@@ -91,6 +90,7 @@ protected:
};
// internal helpers
+ void set_address_bits(int addrbits) { m_command_address_bits = addrbits; }
void set_state(eeprom_state newstate);
void execute_write_command();
@@ -145,7 +145,7 @@ public:
protected:
// construction/destruction
- eeprom_serial_93cxx_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, bool enable_streaming = EEPROM_SERIAL_NO_STREAMING);
+ using eeprom_serial_base_device::eeprom_serial_base_device;
// subclass overrides
virtual void parse_command_and_address() override;
@@ -158,11 +158,7 @@ class eeprom_serial_s29x90_device : public eeprom_serial_93cxx_device
{
protected:
// construction/destruction
- eeprom_serial_s29x90_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, bool ignored = EEPROM_SERIAL_NO_STREAMING)
- : eeprom_serial_93cxx_device(mconfig, devtype, tag, owner, true)
- {
- enable_output_on_falling_clock(true);
- }
+ eeprom_serial_s29x90_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, eeprom_serial_streaming ignored);
};
@@ -182,7 +178,7 @@ public:
protected:
// construction/destruction
- eeprom_serial_er5911_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, bool enable_streaming = EEPROM_SERIAL_NO_STREAMING);
+ using eeprom_serial_base_device::eeprom_serial_base_device;
// subclass overrides
virtual void parse_command_and_address() override;
@@ -206,7 +202,7 @@ public:
protected:
// construction/destruction
- eeprom_serial_x24c44_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner, bool enable_streaming = EEPROM_SERIAL_NO_STREAMING);
+ using eeprom_serial_base_device::eeprom_serial_base_device;
// subclass overrides
virtual void parse_command_and_address() override;
@@ -233,7 +229,8 @@ protected:
class eeprom_serial_##_lowercase##_##_bits##bit_device : public eeprom_serial_##_baseclass##_device \
{ \
public: \
- eeprom_serial_##_lowercase##_##_bits##bit_device(const machine_config &mconfig, const char *tag, device_t *owner, bool enable_streaming = EEPROM_SERIAL_NO_STREAMING); \
+ 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)
diff --git a/src/mame/drivers/cave.cpp b/src/mame/drivers/cave.cpp
index a37f640bcc7..6d6af041b75 100644
--- a/src/mame/drivers/cave.cpp
+++ b/src/mame/drivers/cave.cpp
@@ -2562,7 +2562,7 @@ MACHINE_CONFIG_START(cave_state::pacslot)
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
- MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT, EEPROM_SERIAL_ENABLE_STREAMING)
+ MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT, eeprom_serial_streaming::ENABLE)
MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
@@ -2817,7 +2817,7 @@ MACHINE_CONFIG_START(cave_state::tekkencw)
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
- MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT, EEPROM_SERIAL_ENABLE_STREAMING)
+ MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT, eeprom_serial_streaming::ENABLE)
MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
@@ -2871,7 +2871,7 @@ MACHINE_CONFIG_START(cave_state::tjumpman)
MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
- MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT, EEPROM_SERIAL_ENABLE_STREAMING)
+ MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT, eeprom_serial_streaming::ENABLE)
MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
diff --git a/src/mame/drivers/gaelco3d.cpp b/src/mame/drivers/gaelco3d.cpp
index 848dfeaef82..a93253910bd 100644
--- a/src/mame/drivers/gaelco3d.cpp
+++ b/src/mame/drivers/gaelco3d.cpp
@@ -938,7 +938,7 @@ MACHINE_CONFIG_START(gaelco3d_state::gaelco3d)
MCFG_DEVICE_PROGRAM_MAP(adsp_program_map)
MCFG_DEVICE_DATA_MAP(adsp_data_map)
- MCFG_DEVICE_ADD(m_eeprom, EEPROM_SERIAL_93C66_16BIT, EEPROM_SERIAL_ENABLE_STREAMING)
+ MCFG_DEVICE_ADD(m_eeprom, EEPROM_SERIAL_93C66_16BIT, eeprom_serial_streaming::ENABLE)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
diff --git a/src/mame/drivers/leland.cpp b/src/mame/drivers/leland.cpp
index d9e9c56b8ec..74347bcee0a 100644
--- a/src/mame/drivers/leland.cpp
+++ b/src/mame/drivers/leland.cpp
@@ -1061,7 +1061,7 @@ MACHINE_CONFIG_START(ataxx_state::ataxx)
MCFG_DEVICE_PROGRAM_MAP(slave_map_program)
MCFG_DEVICE_IO_MAP(slave_map_io_2)
- MCFG_DEVICE_ADD(m_eeprom, EEPROM_SERIAL_93C56_16BIT, EEPROM_SERIAL_ENABLE_STREAMING)
+ MCFG_DEVICE_ADD(m_eeprom, EEPROM_SERIAL_93C56_16BIT, eeprom_serial_streaming::ENABLE)
MCFG_NVRAM_ADD_0FILL("battery")
diff --git a/src/mame/drivers/tecmosys.cpp b/src/mame/drivers/tecmosys.cpp
index 8fe8e321be9..f64d5b73168 100644
--- a/src/mame/drivers/tecmosys.cpp
+++ b/src/mame/drivers/tecmosys.cpp
@@ -468,7 +468,7 @@ MACHINE_CONFIG_START(tecmosys_state::tecmosys)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tecmosys)
- MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT, EEPROM_SERIAL_ENABLE_STREAMING)
+ MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT, eeprom_serial_streaming::ENABLE)
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
diff --git a/src/mame/drivers/tmmjprd.cpp b/src/mame/drivers/tmmjprd.cpp
index c2dd01dce9e..f20ddd818be 100644
--- a/src/mame/drivers/tmmjprd.cpp
+++ b/src/mame/drivers/tmmjprd.cpp
@@ -773,7 +773,7 @@ MACHINE_CONFIG_START(tmmjprd_state::tmmjprd)
MCFG_DEVICE_PROGRAM_MAP(tmmjprd_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", tmmjprd_state, scanline, "lscreen", 0, 1)
- MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT, EEPROM_SERIAL_ENABLE_STREAMING)
+ MCFG_DEVICE_ADD("eeprom", EEPROM_SERIAL_93C46_16BIT, eeprom_serial_streaming::ENABLE)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_tmmjprd)