summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/rtc65271.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/rtc65271.cpp')
-rw-r--r--src/devices/machine/rtc65271.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/devices/machine/rtc65271.cpp b/src/devices/machine/rtc65271.cpp
index 1eb84d89171..b39730fb372 100644
--- a/src/devices/machine/rtc65271.cpp
+++ b/src/devices/machine/rtc65271.cpp
@@ -162,10 +162,18 @@ static uint8_t BCD_to_binary(uint8_t data)
void rtc65271_device::nvram_default()
{
- memset(m_regs,0, sizeof(m_regs));
- memset(m_xram,0, sizeof(m_xram));
-
- m_regs[reg_B] |= reg_B_DM; // Firebeat assumes the chip factory defaults to non-BCD mode (or maybe Konami programs it that way?)
+ if (m_default_data.found())
+ {
+ emu_file file(OPEN_FLAG_READ);
+ file.open_ram(m_default_data, m_default_data.bytes());
+ nvram_read(file);
+ }
+ else
+ {
+ memset(m_regs, 0, sizeof(m_regs));
+ memset(m_xram, 0, sizeof(m_xram));
+ m_regs[reg_B] |= reg_B_DM; // Firebeat assumes the chip factory defaults to non-BCD mode (or maybe Konami programs it that way?)
+ }
}
//-------------------------------------------------
@@ -660,6 +668,7 @@ rtc65271_device::rtc65271_device(const machine_config &mconfig, const char *tag,
: device_t(mconfig, RTC65271, tag, owner, clock)
, device_nvram_interface(mconfig, *this)
, m_interrupt_cb(*this)
+ , m_default_data(*this, DEVICE_SELF)
{
}