mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
hd6301: don't save internal registers to nvram when it's not battery backed
This commit is contained in:
parent
4c0957d7f0
commit
cc7db139c2
@ -1571,24 +1571,28 @@ bool hd6301_cpu_device::nvram_write(util::write_stream &file)
|
||||
if (!m6801_cpu_device::nvram_write(file))
|
||||
return false;
|
||||
|
||||
size_t actual;
|
||||
uint8_t buf[7];
|
||||
// skip if it's currently not battery-backed
|
||||
if (m_nvram_battery)
|
||||
{
|
||||
size_t actual;
|
||||
uint8_t buf[7];
|
||||
|
||||
// misc registers
|
||||
buf[0] = m_s.b.h;
|
||||
buf[1] = m_s.b.l;
|
||||
buf[2] = m_x.b.h;
|
||||
buf[3] = m_x.b.l;
|
||||
buf[4] = m_d.b.h;
|
||||
buf[5] = m_d.b.l;
|
||||
buf[6] = m_tdr;
|
||||
// misc registers
|
||||
buf[0] = m_s.b.h;
|
||||
buf[1] = m_s.b.l;
|
||||
buf[2] = m_x.b.h;
|
||||
buf[3] = m_x.b.l;
|
||||
buf[4] = m_d.b.h;
|
||||
buf[5] = m_d.b.l;
|
||||
buf[6] = m_tdr;
|
||||
|
||||
if (file.write(&buf, sizeof(buf), actual) || (sizeof(buf) != actual))
|
||||
return false;
|
||||
if (file.write(&buf, sizeof(buf), actual) || (sizeof(buf) != actual))
|
||||
return false;
|
||||
|
||||
// port output latches
|
||||
if (file.write(&m_port_data[0], sizeof(m_port_data), actual) || sizeof(m_port_data) != actual)
|
||||
return false;
|
||||
// port output latches
|
||||
if (file.write(&m_port_data[0], sizeof(m_port_data), actual) || sizeof(m_port_data) != actual)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1598,11 +1602,15 @@ bool hd6301x_cpu_device::nvram_write(util::write_stream &file)
|
||||
if (!hd6301_cpu_device::nvram_write(file))
|
||||
return false;
|
||||
|
||||
size_t actual;
|
||||
// skip if it's currently not battery-backed
|
||||
if (m_nvram_battery)
|
||||
{
|
||||
size_t actual;
|
||||
|
||||
// port output latches
|
||||
if (file.write(&m_portx_data[0], sizeof(m_portx_data), actual) || sizeof(m_portx_data) != actual)
|
||||
return false;
|
||||
// port output latches
|
||||
if (file.write(&m_portx_data[0], sizeof(m_portx_data), actual) || sizeof(m_portx_data) != actual)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user