machine/7400.cpp: Removed unused 7400 logic device.

This commit is contained in:
Vas Crabb 2023-08-30 04:31:07 +10:00
parent 118d732c30
commit 4701887d6c
3 changed files with 0 additions and 189 deletions

View File

@ -435,18 +435,6 @@ if (MACHINES["7200FIFO"]~=null) then
}
end
---------------------------------------------------
--
--@src/devices/machine/7400.h,MACHINES["TTL7400"] = true
---------------------------------------------------
if (MACHINES["TTL7400"]~=null) then
files {
MAME_DIR .. "src/devices/machine/7400.cpp",
MAME_DIR .. "src/devices/machine/7400.h",
}
end
---------------------------------------------------
--
--@src/devices/machine/7404.h,MACHINES["TTL7404"] = true

View File

@ -1,92 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
/*****************************************************************************
7400 Quad 2-Input NAND Gate
*****************************************************************************/
#include "emu.h"
#include "7400.h"
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_y_func(*this)
, m_a(0)
, m_b(0)
, m_y(0)
{
}
void ttl7400_device::device_start()
{
save_item(NAME(m_a));
save_item(NAME(m_b));
save_item(NAME(m_y));
}
void ttl7400_device::device_reset()
{
m_a = 0;
m_b = 0;
m_y = 0;
}
void ttl7400_device::update()
{
uint8_t last_y = m_y;
m_y = (m_a & m_b) & 0xf;
if (m_y != last_y)
{
for (std::size_t bit = 0; bit < 4; bit++)
{
if (BIT(m_y, bit) == BIT(last_y, bit))
continue;
m_y_func[bit](BIT(m_y, bit));
}
}
}
void ttl7400_device::a_w(uint8_t line, uint8_t state)
{
uint8_t old_a = m_a;
m_a &= ~(1 << line);
m_a |= (state << line);
if (old_a != m_a)
update();
}
void ttl7400_device::b_w(uint8_t line, uint8_t state)
{
uint8_t old_b = m_b;
m_b &= ~(1 << line);
m_b |= (state << line);
if (old_b != m_b)
update();
}
uint8_t ttl7400_device::y_r(uint8_t line)
{
return (m_y >> line) & 1;
}
void ttl7400_device::a1_w(int state) { a_w(0, state); }
void ttl7400_device::a2_w(int state) { a_w(1, state); }
void ttl7400_device::a3_w(int state) { a_w(2, state); }
void ttl7400_device::a4_w(int state) { a_w(3, state); }
void ttl7400_device::b1_w(int state) { b_w(0, state); }
void ttl7400_device::b2_w(int state) { b_w(1, state); }
void ttl7400_device::b3_w(int state) { b_w(2, state); }
void ttl7400_device::b4_w(int state) { b_w(3, state); }
int ttl7400_device::y1_r() { return y_r(0); }
int ttl7400_device::y2_r() { return y_r(1); }
int ttl7400_device::y3_r() { return y_r(2); }
int ttl7400_device::y4_r() { return y_r(3); }

View File

@ -1,85 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
/*****************************************************************************
7400 Quad 2-Input NAND Gate
***********************************************************************
Connection Diagram:
___ ___
1A 1 |* u | 14 Vcc
1B 2 | | 13 4B
1Y 3 | | 12 4A
2A 4 | | 11 4Y
2B 5 | | 10 3B
2Y 6 | | 9 3A
GND 7 |_______| 8 3Y
Truth Table:
___________
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
|___|___|___|
**********************************************************************/
#ifndef MAME_MACHINE_7400_H
#define MAME_MACHINE_7400_H
#pragma once
class ttl7400_device : public device_t
{
public:
// construction/destruction
ttl7400_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
template <std::size_t Bit> auto y_cb() { return m_y_func[Bit].bind(); }
// public interfaces
void a1_w(int state);
void a2_w(int state);
void a3_w(int state);
void a4_w(int state);
void b1_w(int state);
void b2_w(int state);
void b3_w(int state);
void b4_w(int state);
int y1_r();
int y2_r();
int y3_r();
int y4_r();
protected:
void a_w(uint8_t line, uint8_t state);
void b_w(uint8_t line, uint8_t state);
uint8_t y_r(uint8_t line);
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
private:
void update();
// callbacks
devcb_write_line::array<4> m_y_func;
// inputs
uint8_t m_a; // pins 1,4,9,12
uint8_t m_b; // pins 2,5,10,13
// outputs
uint8_t m_y; // pins 3,6,8,11
};
// device type definition
DECLARE_DEVICE_TYPE(TTL7400, ttl7400_device)
#endif // MAME_MACHINE_7400_H