summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/h8/h8.cpp
diff options
context:
space:
mode:
author Vas Crabb <cuavas@users.noreply.github.com>2024-02-25 02:27:26 +1100
committer GitHub <noreply@github.com>2024-02-25 02:27:26 +1100
commit1615b8551a3a73532ac234973cfb04dd8ed98ba4 (patch)
tree25575506b4117afa614b94b4370af7f16eb9dbb5 /src/devices/cpu/h8/h8.cpp
parent334ec12e0043ef939be418283235e3dbe5a005fe (diff)
util/ioprocs.cpp: Added wrappers for common patterns. (#11608)
emu/diimage.h: Removed fread overloads that allocate memory for output. util/core_file.cpp: Changed output size of load to size_t.
Diffstat (limited to 'src/devices/cpu/h8/h8.cpp')
-rw-r--r--src/devices/cpu/h8/h8.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/devices/cpu/h8/h8.cpp b/src/devices/cpu/h8/h8.cpp
index 9f30efc8991..131f9aabf4c 100644
--- a/src/devices/cpu/h8/h8.cpp
+++ b/src/devices/cpu/h8/h8.cpp
@@ -215,11 +215,10 @@ bool h8_device::nvram_write(util::write_stream &file)
if(!m_nvram_battery)
return true;
- size_t actual;
-
// internal RAM
if(m_internal_ram) {
- if(file.write(&m_internal_ram[0], m_internal_ram.bytes(), actual) || m_internal_ram.bytes() != actual)
+ auto const [err, actual] = write(file, &m_internal_ram[0], m_internal_ram.bytes());
+ if(err)
return false;
}
@@ -234,11 +233,10 @@ bool h8_device::nvram_write(util::write_stream &file)
bool h8_device::nvram_read(util::read_stream &file)
{
- size_t actual;
-
// internal RAM
if(m_internal_ram) {
- if(file.read(&m_internal_ram[0], m_internal_ram.bytes(), actual) || m_internal_ram.bytes() != actual)
+ auto const [err, actual] = read(file, &m_internal_ram[0], m_internal_ram.bytes());
+ if (err || (m_internal_ram.bytes() != actual))
return false;
}