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.
This commit is contained in:
AJR 2017-08-18 13:44:26 -04:00
parent 76755648e1
commit c0e752323d
3 changed files with 14 additions and 3 deletions

View File

@ -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);
}
//-------------------------------------------------

View File

@ -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;

View File

@ -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()