summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/gen_latch.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-08-18 13:44:26 -0400
committer AJR <ajrhacker@users.noreply.github.com>2017-08-18 13:49:45 -0400
commitc0e752323d6b0167da4b378c08fb9330763912b6 (patch)
treef6c526d5fbf46ce079fbddecbd78d0bf2422fe04 /src/devices/machine/gen_latch.cpp
parent76755648e14fe1042ba7c235435a700868494b81 (diff)
gen_latch: Synchronize at start to ensure broadcast of initial "not written" state (nw)
This fixes sound in onna34ro and makes the nycaptor hack unnecessary. Occasional sound loss in flstory remains, but that driver is IMPERFECT_SOUND anyway; I suspect the fault there may lie with the emulation of the MSM5232 or its interface to the Z80 here.
Diffstat (limited to 'src/devices/machine/gen_latch.cpp')
-rw-r--r--src/devices/machine/gen_latch.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/devices/machine/gen_latch.cpp b/src/devices/machine/gen_latch.cpp
index 560408cee5c..cb1fefda60c 100644
--- a/src/devices/machine/gen_latch.cpp
+++ b/src/devices/machine/gen_latch.cpp
@@ -42,6 +42,18 @@ void generic_latch_base_device::device_start()
{
m_data_pending_cb.resolve_safe();
save_item(NAME(m_latch_written));
+
+ // synchronization is needed since other devices may not be initialized yet
+ machine().scheduler().synchronize(timer_expired_delegate(FUNC(generic_latch_base_device::init_callback), this));
+}
+
+//-------------------------------------------------
+// init_callback - set initial state
+//-------------------------------------------------
+
+void generic_latch_base_device::init_callback(void *ptr, s32 param)
+{
+ m_data_pending_cb(m_latch_written ? 1 : 0);
}
//-------------------------------------------------