diff options
| author | 2018-08-11 15:00:54 +0200 | |
|---|---|---|
| committer | 2018-08-11 15:01:20 +0200 | |
| commit | d5d598a1c021c19e992e5f4cd8f56aa8c697076e (patch) | |
| tree | 3deeca26e7b770f0140041a1902d3b9bee21f6f4 /src/devices/machine/7400.cpp | |
| parent | 543e49cc2443e3ab531168ec80e93dd3afeea795 (diff) | |
-7200fifo, 7400, 7404, 74123, 74145, 74148, 74153, 74157, 74161, 74259: [Ryan Holtz]
* Removed MCFG and old devcb macros.
AJR, any breakage? nw
Diffstat (limited to 'src/devices/machine/7400.cpp')
| -rw-r--r-- | src/devices/machine/7400.cpp | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/src/devices/machine/7400.cpp b/src/devices/machine/7400.cpp index 595ce09ac32..a7c4e1528b4 100644 --- a/src/devices/machine/7400.cpp +++ b/src/devices/machine/7400.cpp @@ -13,10 +13,7 @@ DEFINE_DEVICE_TYPE(TTL7400, ttl7400_device, "7400", "7400 Quad 2-Input NAND Gate ttl7400_device::ttl7400_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TTL7400, tag, owner, clock) - , m_y1_func(*this) - , m_y2_func(*this) - , m_y3_func(*this) - , m_y4_func(*this) + , m_y_func{{*this}, {*this}, {*this}, {*this}} , m_a(0) , m_b(0) , m_y(0) @@ -25,25 +22,16 @@ ttl7400_device::ttl7400_device(const machine_config &mconfig, const char *tag, d void ttl7400_device::device_start() { - init(); - save_item(NAME(m_a)); save_item(NAME(m_b)); save_item(NAME(m_y)); - m_y1_func.resolve_safe(); - m_y2_func.resolve_safe(); - m_y3_func.resolve_safe(); - m_y4_func.resolve_safe(); + for (std::size_t bit = 0; bit < 4; bit++) + m_y_func[bit].resolve_safe(); } void ttl7400_device::device_reset() { - init(); -} - -void ttl7400_device::init() -{ m_a = 0; m_b = 0; m_y = 0; @@ -57,18 +45,12 @@ void ttl7400_device::update() if (m_y != last_y) { - for (int bit = 0; bit < 4; bit++) + for (std::size_t bit = 0; bit < 4; bit++) { if (BIT(m_y, bit) == BIT(last_y, bit)) continue; - switch(bit) - { - case 0: m_y1_func(BIT(m_y, bit)); break; - case 1: m_y2_func(BIT(m_y, bit)); break; - case 2: m_y3_func(BIT(m_y, bit)); break; - case 3: m_y4_func(BIT(m_y, bit)); break; - } + m_y_func[bit](BIT(m_y, bit)); } } } |
