1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
/**********************************************************************
AMD Am2847/Am2896 Quad 80/96-Bit Static Shift Registers
Pin-compatible with:
* 2532B
* TMS3120
* TMS3409
* MK1007
* 3347
***********************************************************************
Connection Diagram:
___ ___
OUT A 1 |* u | 16 Vss
RC A 2 | | 15 IN D
IN A 3 | | 14 RC D
OUT B 4 | | 13 OUT D
RC B 5 | | 12 Vgg
IN B 6 | | 11 CP
OUT C 7 | | 10 IN C
Vdd 8 |_______| 9 RC C
Logic Symbol:
2 5 9 14
| | | |
_____|______|______|______|_____
| RC A RC B RC C RC D |
3 ---| IN A OUT A |--- 1
6 ---| IN A OUT B |--- 4
10 ---| IN A OUT C |--- 7
15 ---| IN A OUT D |--- 13
11 ---| CP |
|________________________________|
**********************************************************************/
#ifndef MAME_MACHINE_AM2847_H
#define MAME_MACHINE_AM2847_H
#pragma once
class am2847_base_device : public device_t
{
public:
DECLARE_WRITE_LINE_MEMBER( in_a_w );
DECLARE_WRITE_LINE_MEMBER( in_b_w );
DECLARE_WRITE_LINE_MEMBER( in_c_w );
DECLARE_WRITE_LINE_MEMBER( in_d_w );
void in_w(uint8_t data);
DECLARE_WRITE_LINE_MEMBER( rc_a_w );
DECLARE_WRITE_LINE_MEMBER( rc_b_w );
DECLARE_WRITE_LINE_MEMBER( rc_c_w );
DECLARE_WRITE_LINE_MEMBER( rc_d_w );
void rc_w(uint8_t data);
DECLARE_WRITE_LINE_MEMBER( cp_w );
uint8_t out_r() const { return m_out; }
protected:
am2847_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, const XTAL &clock, size_t size);
virtual void device_start() override;
virtual void device_reset() override;
void init();
void shift();
class shifter
{
public:
shifter() : m_buffer_size(0) { }
void alloc(size_t size);
void init();
int shift(bool recycle, int in);
protected:
std::unique_ptr<uint16_t[]> m_buffer;
size_t m_buffer_size;
};
shifter m_shifters[4];
uint8_t m_in;
uint8_t m_out;
uint8_t m_rc;
int m_cp;
const size_t m_buffer_size;
};
class am2847_device : public am2847_base_device
{
public:
// construction/destruction
am2847_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock);
};
class am2849_device : public am2847_base_device
{
public:
// construction/destruction
am2849_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock);
};
class tms3409_device : public am2847_base_device
{
public:
// construction/destruction
tms3409_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock);
};
// device type definition
DECLARE_DEVICE_TYPE(AM2847, am2847_device)
DECLARE_DEVICE_TYPE(AM2849, am2849_device)
DECLARE_DEVICE_TYPE(TMS3409, tms3409_device)
#endif // MAME_MACHINE_AM2847_H
|