summaryrefslogtreecommitdiffstatshomepage
path: root/src
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
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')
-rw-r--r--src/devices/machine/gen_latch.cpp12
-rw-r--r--src/devices/machine/gen_latch.h2
-rw-r--r--src/mame/drivers/nycaptor.cpp3
3 files changed, 14 insertions, 3 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);
}
//-------------------------------------------------
diff --git a/src/devices/machine/gen_latch.h b/src/devices/machine/gen_latch.h
index d41717c4469..4e7aecf791c 100644
--- a/src/devices/machine/gen_latch.h
+++ b/src/devices/machine/gen_latch.h
@@ -67,6 +67,8 @@ protected:
void set_latch_written(bool latch_written);
private:
+ void init_callback(void *ptr, s32 param);
+
bool m_separate_acknowledge;
bool m_latch_written;
devcb_write_line m_data_pending_cb;
diff --git a/src/mame/drivers/nycaptor.cpp b/src/mame/drivers/nycaptor.cpp
index 45664a55506..913dfc71c28 100644
--- a/src/mame/drivers/nycaptor.cpp
+++ b/src/mame/drivers/nycaptor.cpp
@@ -733,9 +733,6 @@ void nycaptor_state::machine_start()
save_item(NAME(m_char_bank));
save_item(NAME(m_palette_bank));
save_item(NAME(m_gfxctrl));
-
- // hack to put input_merger in correct initial state
- m_soundnmi->in_w<0>(0);
}
void nycaptor_state::machine_reset()