mirror of
https://github.com/holub/mame
synced 2025-06-05 12:26:35 +03:00
input_merger: remove awkward initial_state setter, add notes
This commit is contained in:
parent
18ac15ba9e
commit
0ed664f5e8
@ -14,8 +14,15 @@ Default initial input pin(s) state:
|
||||
- ALL_LOW: 0
|
||||
|
||||
TODO:
|
||||
- call output handler at reset? eg. a NAND gate whose inputs are low at
|
||||
power-on should output 1.
|
||||
- Change the strange initial input state, eg. right now it's all 1 for an AND
|
||||
gate. All 0 for all devices would be more intuitive, but that would need a
|
||||
config handler for setting the number of input pins since otherwise it can't
|
||||
know if the state is active or not.
|
||||
- Call m_output_handler at reset, eg. a NOR gate whose inputs are low at power-on
|
||||
should output 1 (to avoid surprises, this should be done after machine_reset).
|
||||
- Related to currently not calling m_output_handler at reset, if the hardware
|
||||
1st value written equals the initial state, m_output_handler is not called,
|
||||
eg. writing 1 to an AND gate pin when the default initial state is 1.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
|
@ -21,7 +21,6 @@ class input_merger_device : public device_t
|
||||
public:
|
||||
// configuration
|
||||
auto output_handler() { return m_output_handler.bind(); }
|
||||
auto &initial_state(u32 val) { m_initval = val; return *this; } // initial input pin(s) state, be wary about the unused pins
|
||||
|
||||
// input lines
|
||||
template <unsigned Bit> DECLARE_WRITE_LINE_MEMBER(in_w) { static_assert(Bit < 32, "invalid bit"); machine().scheduler().synchronize(timer_expired_delegate(FUNC(input_merger_device::update_state), this), (Bit << 1) | (state ? 1U : 0U)); }
|
||||
@ -48,7 +47,7 @@ protected:
|
||||
|
||||
devcb_write_line m_output_handler;
|
||||
|
||||
u32 m_initval;
|
||||
u32 const m_initval;
|
||||
u32 const m_xorval;
|
||||
int const m_active;
|
||||
u32 m_state;
|
||||
|
@ -372,7 +372,7 @@ void leo_state::leonardo(machine_config &config)
|
||||
m_maincpu->in_p6_cb().set(FUNC(leo_state::p6_r));
|
||||
m_maincpu->out_p6_cb().set(FUNC(leo_state::p6_w));
|
||||
|
||||
INPUT_MERGER_ANY_LOW(config, m_stb).initial_state(~u32(3));
|
||||
INPUT_MERGER_ANY_LOW(config, m_stb);
|
||||
m_stb->output_handler().set_inputline(m_maincpu, M6801_IS_LINE);
|
||||
|
||||
config.set_maximum_quantum(attotime::from_hz(6000));
|
||||
|
@ -361,7 +361,7 @@ void ren_state::ren(machine_config &config)
|
||||
m_maincpu->in_p6_cb().set(FUNC(ren_state::p6_r));
|
||||
m_maincpu->out_p6_cb().set(FUNC(ren_state::p6_w));
|
||||
|
||||
INPUT_MERGER_ANY_LOW(config, m_stb).initial_state(~u32(3));
|
||||
INPUT_MERGER_ANY_LOW(config, m_stb);
|
||||
m_stb->output_handler().set_inputline(m_maincpu, M6801_IS_LINE);
|
||||
|
||||
config.set_maximum_quantum(attotime::from_hz(6000));
|
||||
|
Loading…
Reference in New Issue
Block a user