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
|
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
/***************************************************************************
am25s55x.h
AMD Am25S557/Am25S558 8x8-bit Combinatorial Multiplier
***************************************************************************/
#ifndef MAME_MACHINE_AM25S55X_H
#define MAME_MACHINE_AM25S55X_H
#pragma once
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> am25s55x_device
class am25s55x_device : public device_t
{
public:
// construction/destruction
am25s55x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, const XTAL &clock = XTAL());
void x_w(uint8_t data);
void y_w(uint8_t data);
virtual void xm_w(int state);
virtual void ym_w(int state);
void oe_w(int state);
auto s() { return m_s.bind(); }
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
void multiply();
union input_reg
{
int8_t s;
uint8_t u;
};
union output_reg
{
int16_t s;
uint16_t u;
};
uint8_t m_x_in;
uint8_t m_y_in;
bool m_xm;
bool m_ym;
bool m_oe;
bool m_round_s;
bool m_round_u;
input_reg m_x;
input_reg m_y;
output_reg m_s_out;
devcb_write16 m_s;
};
// ======================> am25s557_device
class am25s557_device : public am25s55x_device
{
public:
// construction/destruction
am25s557_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock = XTAL());
virtual void xm_w(int state) override;
virtual void ym_w(int state) override;
void r_w(int state);
protected:
virtual void device_start() override;
virtual void device_reset() override;
void update_rounding();
bool m_r;
};
// ======================> am25s558_device
class am25s558_device : public am25s55x_device
{
public:
// construction/destruction
am25s558_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock = XTAL());
void rs_w(int state);
void ru_w(int state);
};
// device type definition
DECLARE_DEVICE_TYPE(AM25S557, am25s557_device)
DECLARE_DEVICE_TYPE(AM25S558, am25s558_device)
#endif // MAME_MACHINE_AM25S55X_H
|