mirror of
https://github.com/holub/mame
synced 2025-07-05 01:48:29 +03:00
gen_latch: add boost interleave conf setting
This commit is contained in:
parent
f6942dd17a
commit
229ea4b3a1
@ -35,6 +35,7 @@ generic_latch_base_device::generic_latch_base_device(const machine_config &mconf
|
||||
device_t(mconfig, type, tag, owner, clock),
|
||||
m_separate_acknowledge(false),
|
||||
m_latch_written(false),
|
||||
m_boost_after_write(attotime::zero),
|
||||
m_data_pending_cb(*this)
|
||||
{
|
||||
}
|
||||
@ -91,6 +92,11 @@ void generic_latch_base_device::set_latch_written(bool latch_written)
|
||||
{
|
||||
m_latch_written = latch_written;
|
||||
m_data_pending_cb(latch_written ? 1 : 0);
|
||||
|
||||
// MAME can't time travel in case of tight back and forth comms.
|
||||
// Instead of adding perfect quantum, boosting interleave may work around it.
|
||||
if (latch_written && !m_boost_after_write.is_zero())
|
||||
machine().scheduler().boost_interleave(attotime::zero, m_boost_after_write);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,7 @@ public:
|
||||
// configuration
|
||||
auto data_pending_callback() { return m_data_pending_cb.bind(); }
|
||||
void set_separate_acknowledge(bool ack) { m_separate_acknowledge = ack; }
|
||||
void boost_after_write(attotime duration) { m_boost_after_write = duration; }
|
||||
|
||||
DECLARE_READ_LINE_MEMBER(pending_r);
|
||||
|
||||
@ -55,6 +56,7 @@ private:
|
||||
|
||||
bool m_separate_acknowledge;
|
||||
bool m_latch_written;
|
||||
attotime m_boost_after_write;
|
||||
devcb_write_line m_data_pending_cb;
|
||||
};
|
||||
|
||||
|
@ -208,7 +208,7 @@ driver_device_creator< \
|
||||
///
|
||||
/// Use this macro to define most systems intended for public use,
|
||||
/// including arcade games, gambling machines, vending machines, and
|
||||
/// information kiosks. Muse be used in the global namespace.
|
||||
/// information kiosks. Must be used in the global namespace.
|
||||
///
|
||||
/// Creates an appropriately named and populated #game_driver structure
|
||||
/// describing the system.
|
||||
|
@ -778,7 +778,7 @@ void atarisy1_state::atarisy1(machine_config &config)
|
||||
|
||||
GENERIC_LATCH_8(config, m_soundlatch);
|
||||
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, m6502_device::NMI_LINE);
|
||||
m_soundlatch->data_pending_callback().append([this](int state) { if (state) machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); });
|
||||
m_soundlatch->boost_after_write(attotime::from_usec(100));
|
||||
|
||||
GENERIC_LATCH_8(config, m_mainlatch);
|
||||
m_mainlatch->data_pending_callback().set_inputline(m_maincpu, M68K_IRQ_6);
|
||||
|
@ -1259,7 +1259,7 @@ void atarisy2_state::atarisy2(machine_config &config)
|
||||
|
||||
GENERIC_LATCH_8(config, m_soundlatch);
|
||||
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, m6502_device::NMI_LINE);
|
||||
m_soundlatch->data_pending_callback().append([this](int state) { if (state) machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(200)); });
|
||||
m_soundlatch->boost_after_write(attotime::from_usec(200)); // apb3 fails the self-test with a 100 µs delay or less
|
||||
|
||||
GENERIC_LATCH_8(config, m_mainlatch);
|
||||
|
||||
|
@ -507,7 +507,7 @@ void gauntlet_state::gauntlet_base(machine_config &config)
|
||||
|
||||
GENERIC_LATCH_8(config, m_soundlatch);
|
||||
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, m6502_device::NMI_LINE);
|
||||
m_soundlatch->data_pending_callback().append([this](int state) { if (state) machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); });
|
||||
m_soundlatch->boost_after_write(attotime::from_usec(100));
|
||||
|
||||
GENERIC_LATCH_8(config, m_mainlatch);
|
||||
m_mainlatch->data_pending_callback().set_inputline(m_maincpu, M68K_IRQ_6);
|
||||
|
@ -315,11 +315,11 @@ void starwars_state::starwars(machine_config &config)
|
||||
|
||||
GENERIC_LATCH_8(config, m_soundlatch);
|
||||
m_soundlatch->data_pending_callback().set(m_riot, FUNC(riot6532_device::pa7_w));
|
||||
m_soundlatch->data_pending_callback().append([this](int state) { if (state) machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); });
|
||||
m_soundlatch->boost_after_write(attotime::from_usec(100));
|
||||
|
||||
GENERIC_LATCH_8(config, m_mainlatch);
|
||||
m_mainlatch->data_pending_callback().set(m_riot, FUNC(riot6532_device::pa6_w));
|
||||
m_mainlatch->data_pending_callback().append([this](int state) { if (state) machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); });
|
||||
m_mainlatch->boost_after_write(attotime::from_usec(100));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user