From c57e1e7e40ccbe1e9a093b5c75e044c75cfb2033 Mon Sep 17 00:00:00 2001 From: r09 Date: Fri, 25 Nov 2022 14:56:42 +0100 Subject: machine/upd71071.cpp: Initialize address and count registers - fixes random HDD failures in fmtowns. (#10580) --- src/devices/machine/upd71071.cpp | 6 ++++-- 1 file 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)); -- cgit v1.2.3