summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/eeprompar.h
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-08-30 00:17:11 -0400
committer AJR <ajrhacker@users.noreply.github.com>2017-08-30 00:17:11 -0400
commit50749667bb8b6d0b92d187dffc9dcb0a03907375 (patch)
treea35ae42fa7fe7aff6f3c823bc5af724c14aca8af /src/devices/machine/eeprompar.h
parentdbae1f4e05cac302e75d3779cf91d9ff8e928f85 (diff)
Improvements to 28XX parallel EEPROM emulation
- Emulate direct manipulation of /OE line for read/write mode control. - Special handling for data polling before a write has completed. - Allow optional configuration of device to lock EEPROM after each write, as often used by Atari. - Eliminate the Atari EEPROM interface devices, since their special features have been incorporated into the base device. To continue using old NVRAM files, rename them from eeprom_eeprom to eeprom.
Diffstat (limited to 'src/devices/machine/eeprompar.h')
-rw-r--r--src/devices/machine/eeprompar.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/devices/machine/eeprompar.h b/src/devices/machine/eeprompar.h
index 62a4b539e8b..2370f1c0e46 100644
--- a/src/devices/machine/eeprompar.h
+++ b/src/devices/machine/eeprompar.h
@@ -38,6 +38,9 @@
#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) \
+ eeprom_parallel_28xx_device::static_set_lock_after_write(*device, _lock);
//**************************************************************************
@@ -65,14 +68,33 @@ protected:
class eeprom_parallel_28xx_device : public eeprom_parallel_base_device
{
public:
- // read/write data lines - for now we cheat and ignore the control lines, assuming
- // they are handled reasonably
+ // static configuration helpers
+ static void static_set_lock_after_write(device_t &device, bool lock);
+
+ // read/write data lines
DECLARE_WRITE8_MEMBER(write);
DECLARE_READ8_MEMBER(read);
+ // control lines
+ DECLARE_WRITE_LINE_MEMBER(oe_w);
+ DECLARE_WRITE8_MEMBER(unlock_write);
+ DECLARE_WRITE16_MEMBER(unlock_write);
+ DECLARE_WRITE32_MEMBER(unlock_write);
+
protected:
// construction/destruction
eeprom_parallel_28xx_device(const machine_config &mconfig, device_type devtype, const char *tag, device_t *owner);
+
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+private:
+ // configuration state
+ bool m_lock_after_write; // lock EEPROM after writes
+
+ // runtime state
+ int m_oe; // state of OE line (-1 = synchronized with read)
};