diff options
author | 2022-08-31 00:50:02 +0200 | |
---|---|---|
committer | 2022-08-31 00:50:02 +0200 | |
commit | 229ea4b3a1b44bd558e2c99c31dfe3ad66c34ea0 (patch) | |
tree | 6e27262ed2c682201ec7f0759368f72a05f1aa27 | |
parent | f6942dd17a67d7db3c2eb3a2bc43552c6b8bca0d (diff) |
gen_latch: add boost interleave conf setting
-rw-r--r-- | src/devices/machine/gen_latch.cpp | 6 | ||||
-rw-r--r-- | src/devices/machine/gen_latch.h | 2 | ||||
-rw-r--r-- | src/emu/gamedrv.h | 2 | ||||
-rw-r--r-- | src/mame/atari/atarisy1.cpp | 2 | ||||
-rw-r--r-- | src/mame/atari/atarisy2.cpp | 2 | ||||
-rw-r--r-- | src/mame/atari/gauntlet.cpp | 2 | ||||
-rw-r--r-- | src/mame/atari/starwars.cpp | 4 |
7 files changed, 14 insertions, 6 deletions
diff --git a/src/devices/machine/gen_latch.cpp b/src/devices/machine/gen_latch.cpp index 10caccd4c7c..1ac3ea50eaf 100644 --- a/src/devices/machine/gen_latch.cpp +++ b/src/devices/machine/gen_latch.cpp @@ -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); } } diff --git a/src/devices/machine/gen_latch.h b/src/devices/machine/gen_latch.h index fc217410d06..682c6093b01 100644 --- a/src/devices/machine/gen_latch.h +++ b/src/devices/machine/gen_latch.h @@ -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; }; diff --git a/src/emu/gamedrv.h b/src/emu/gamedrv.h index a1cb8a40155..5ca3a653506 100644 --- a/src/emu/gamedrv.h +++ b/src/emu/gamedrv.h @@ -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. diff --git a/src/mame/atari/atarisy1.cpp b/src/mame/atari/atarisy1.cpp index 4c05546d020..c11b949e10f 100644 --- a/src/mame/atari/atarisy1.cpp +++ b/src/mame/atari/atarisy1.cpp @@ -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); diff --git a/src/mame/atari/atarisy2.cpp b/src/mame/atari/atarisy2.cpp index 16ce74a0bbd..7f0c1872659 100644 --- a/src/mame/atari/atarisy2.cpp +++ b/src/mame/atari/atarisy2.cpp @@ -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); diff --git a/src/mame/atari/gauntlet.cpp b/src/mame/atari/gauntlet.cpp index eedf636b223..e3cf1fc6e3a 100644 --- a/src/mame/atari/gauntlet.cpp +++ b/src/mame/atari/gauntlet.cpp @@ -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); diff --git a/src/mame/atari/starwars.cpp b/src/mame/atari/starwars.cpp index d0e8d5a1190..1ce4ca834db 100644 --- a/src/mame/atari/starwars.cpp +++ b/src/mame/atari/starwars.cpp @@ -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)); } |