summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author r09 <rzero9@gmail.com>2022-11-25 14:56:42 +0100
committer GitHub <noreply@github.com>2022-11-26 00:56:42 +1100
commitc57e1e7e40ccbe1e9a093b5c75e044c75cfb2033 (patch)
tree1f6f02b1598990fffc5f42a064ff131569618c77 /src/devices
parentdefc5c612dac97f4ff27e76efb66052656bec03a (diff)
machine/upd71071.cpp: Initialize address and count registers - fixes random HDD failures in fmtowns. (#10580)
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/machine/upd71071.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/devices/machine/upd71071.cpp b/src/devices/machine/upd71071.cpp
index 0a928be5361..0bada0f3b37 100644
--- a/src/devices/machine/upd71071.cpp
+++ b/src/devices/machine/upd71071.cpp
@@ -122,8 +122,10 @@ void upd71071_device::device_start()
m_reg.device_control = 0;
m_reg.mask = 0x0f; // mask all channels
- for (int x = 0; x < 4; x++)
- m_reg.mode_control[x] = 0;
+
+ std::fill(std::begin(m_reg.address_current), std::end(m_reg.address_current), 0);
+ std::fill(std::begin(m_reg.count_current), std::end(m_reg.count_current), 0);
+ std::fill(std::begin(m_reg.mode_control), std::end(m_reg.mode_control), 0);
save_item(NAME(m_reg.initialise));
save_item(NAME(m_reg.channel));