summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/input_merger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/input_merger.cpp')
-rw-r--r--src/devices/machine/input_merger.cpp38
1 files changed, 27 insertions, 11 deletions
diff --git a/src/devices/machine/input_merger.cpp b/src/devices/machine/input_merger.cpp
index 28652cdb66f..51c052fc096 100644
--- a/src/devices/machine/input_merger.cpp
+++ b/src/devices/machine/input_merger.cpp
@@ -2,10 +2,27 @@
// copyright-holders:Dirk Best, Vas Crabb
/***************************************************************************
- Input Merger
-
- Used to connect multiple lines to a single device input while
- keeping it pulled high or low
+Input Merger
+
+Used to connect multiple lines to a single device input while keeping it
+pulled high or low.
+
+Default initial input pin(s) state:
+- ANY_HIGH: 0
+- ALL_HIGH: 1
+- ANY_LOW: 1
+- ALL_LOW: 0
+
+TODO:
+- 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.
***************************************************************************/
@@ -23,10 +40,10 @@
// DEVICE DEFINITIONS
//**************************************************************************
-DEFINE_DEVICE_TYPE(INPUT_MERGER_ANY_HIGH, input_merger_any_high_device, "ipt_merge_any_hi", "Input Merger (any high)")
-DEFINE_DEVICE_TYPE(INPUT_MERGER_ALL_HIGH, input_merger_all_high_device, "ipt_merge_all_hi", "Input Merger (all high)")
-DEFINE_DEVICE_TYPE(INPUT_MERGER_ANY_LOW, input_merger_any_low_device, "ipt_merge_any_lo", "Input Merger (any low)")
-DEFINE_DEVICE_TYPE(INPUT_MERGER_ALL_LOW, input_merger_all_low_device, "ipt_merge_all_lo", "Input Merger (all low)")
+DEFINE_DEVICE_TYPE(INPUT_MERGER_ANY_HIGH, input_merger_any_high_device, "ipt_merge_any_hi", "Input Merger (any high)") // OR
+DEFINE_DEVICE_TYPE(INPUT_MERGER_ALL_HIGH, input_merger_all_high_device, "ipt_merge_all_hi", "Input Merger (all high)") // AND
+DEFINE_DEVICE_TYPE(INPUT_MERGER_ANY_LOW, input_merger_any_low_device, "ipt_merge_any_lo", "Input Merger (any low)") // NAND
+DEFINE_DEVICE_TYPE(INPUT_MERGER_ALL_LOW, input_merger_all_low_device, "ipt_merge_all_lo", "Input Merger (all low)") // NOR
//**************************************************************************
@@ -69,7 +86,6 @@ input_merger_device::~input_merger_device()
void input_merger_device::device_start()
{
- m_output_handler.resolve_safe();
save_item(NAME(m_state));
m_state = m_initval;
}
@@ -93,12 +109,12 @@ TIMER_CALLBACK_MEMBER(input_merger_device::update_state)
// SPECIALISATIONS
//**************************************************************************
-input_merger_any_high_device::input_merger_any_high_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
+input_merger_any_high_device::input_merger_any_high_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
: input_merger_device(mconfig, INPUT_MERGER_ANY_HIGH, tag, owner, clock, u32(0), u32(0), 1)
{
}
-input_merger_all_high_device::input_merger_all_high_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
+input_merger_all_high_device::input_merger_all_high_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
: input_merger_device(mconfig, INPUT_MERGER_ALL_HIGH, tag, owner, clock, ~u32(0), ~u32(0), 0)
{
}