summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author David Haywood <hazemamewip@hotmail.com>2018-08-23 16:24:13 +0100
committer R. Belmont <rb6502@users.noreply.github.com>2018-08-23 11:24:13 -0400
commit12b2f888e286e0d67bb8cc432efbba9af0cf3938 (patch)
tree771c122d56384b3e6ab9811a3f3307322ba58070 /src/devices
parente3a13bf8e2d416b174d11fccba0d962c8c32eed8 (diff)
misc small fixes (btime.cpp note, nightmare.cpp defaults) (#3885)
* misc (nw) * whitespace (nw)
Diffstat (limited to 'src/devices')
-rwxr-xr-xsrc/devices/machine/sda2006.cpp19
-rwxr-xr-xsrc/devices/machine/sda2006.h37
2 files changed, 35 insertions, 21 deletions
diff --git a/src/devices/machine/sda2006.cpp b/src/devices/machine/sda2006.cpp
index cfa31d9591d..aef96819c8f 100755
--- a/src/devices/machine/sda2006.cpp
+++ b/src/devices/machine/sda2006.cpp
@@ -36,7 +36,16 @@ DEFINE_DEVICE_TYPE(SDA2006, sda2006_device, "sda2006", "SDA2006 EEPROM")
sda2006_device::sda2006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, SDA2006, tag, owner, clock)
, device_nvram_interface(mconfig, *this)
- , m_latch(0), m_current_address(0), m_eeprom_state(),m_read_stream_pos(0),m_is_end_o_stream(false), m_write_stream_length(0), m_write_stream(0), m_write_state(0), m_clock_state (0)
+ , m_latch(0)
+ , m_current_address(0)
+ , m_eeprom_state()
+ , m_read_stream_pos(0)
+ , m_is_end_o_stream(false)
+ , m_write_stream_length(0)
+ , m_write_stream(0)
+ , m_write_state(0)
+ , m_clock_state(0)
+ , m_region(*this, DEVICE_SELF)
{
}
@@ -80,7 +89,6 @@ void sda2006_device::device_reset()
m_read_stream_pos = 0;
m_eeprom_state = EEPROM_WRITE;
m_clock_state = 0;
-
}
//-------------------------------------------------
@@ -90,6 +98,13 @@ void sda2006_device::device_reset()
void sda2006_device::nvram_default()
{
+ // region always wins
+ if (m_region.found())
+ {
+ memcpy(m_eeprom_data, m_region->base(), EEPROM_CAPACITY);
+ return;
+ }
+
for (auto & elem : m_eeprom_data)
elem = 0xffff;
}
diff --git a/src/devices/machine/sda2006.h b/src/devices/machine/sda2006.h
index 51fb91446d2..c17f655ef0a 100755
--- a/src/devices/machine/sda2006.h
+++ b/src/devices/machine/sda2006.h
@@ -9,18 +9,18 @@
// sda2006_device
-class sda2006_device : public device_t,
- public device_nvram_interface
+class sda2006_device : public device_t,
+ public device_nvram_interface
{
public:
// construction/destruction
sda2006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
// I/O operations
- DECLARE_READ_LINE_MEMBER( read_data );
- DECLARE_WRITE_LINE_MEMBER( write_data );
- DECLARE_WRITE_LINE_MEMBER( write_clock );
- DECLARE_WRITE_LINE_MEMBER( write_enable );
+ DECLARE_READ_LINE_MEMBER(read_data);
+ DECLARE_WRITE_LINE_MEMBER(write_data);
+ DECLARE_WRITE_LINE_MEMBER(write_clock);
+ DECLARE_WRITE_LINE_MEMBER(write_enable);
protected:
// device-level overrides
@@ -38,19 +38,18 @@ private:
EEPROM_WRITE
};
- uint8_t m_latch;
- uint8_t m_current_address;
- uint32_t m_eeprom_state;
- uint8_t m_read_stream_pos;
- bool m_is_end_o_stream;
- uint8_t m_write_stream_length;
- uint32_t m_write_stream;
- uint8_t m_write_state;
- uint8_t m_clock_state;
-
-
-
- uint16_t m_eeprom_data[0x20];
+ uint8_t m_latch;
+ uint8_t m_current_address;
+ uint32_t m_eeprom_state;
+ uint8_t m_read_stream_pos;
+ bool m_is_end_o_stream;
+ uint8_t m_write_stream_length;
+ uint32_t m_write_stream;
+ uint8_t m_write_state;
+ uint8_t m_clock_state;
+
+ optional_memory_region m_region;
+ uint16_t m_eeprom_data[0x20];
};