summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/mcs51/i80c52.h
blob: 2b4b0f344ddb52363dbcdb235fef657033531b34 (plain) (blame)
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
// license:BSD-3-Clause
// copyright-holders:Steve Ellenoff, Manuel Abadia, Couriersud

#ifndef MAME_CPU_MCS51_I80C52_H
#define MAME_CPU_MCS51_I80C52_H

#pragma once

#include "i8052.h"

class i80c52_device : public i8052_device
{
public:
	// construction/destruction
	i80c52_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);

protected:
	u8 m_saddr, m_saden;

	i80c52_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int program_width);
	virtual void device_start() override ATTR_COLD;
	virtual void device_reset() override ATTR_COLD;

	virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;

	virtual void sfr_map(address_map &map) override ATTR_COLD;

	u8 iph_r();
	void iph_w(u8 data);
	u8 saddr_r();
	void saddr_w(u8 data);
	u8 saden_r();
	void saden_w(u8 data);
};

class i80c32_device : public i80c52_device
{
public:
	// construction/destruction
	i80c32_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};

class i87c52_device : public i80c52_device
{
public:
	// construction/destruction
	i87c52_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};

class i87c51fa_device : public i80c52_device
{
public:
	// construction/destruction
	i87c51fa_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);

protected:
	i87c51fa_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int program_width);

	virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
};

class i80c51gb_device : public i87c51fa_device
{
public:
	// construction/destruction
	i80c51gb_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);

protected:
	virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
};

class at89c52_device : public i80c52_device
{
public:
	// construction/destruction
	at89c52_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};

class at89s52_device : public i80c52_device
{
public:
	// construction/destruction
	at89s52_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
};

class ds80c320_device : public i80c52_device
{
public:
	// construction/destruction
	ds80c320_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);

protected:
	virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
};

DECLARE_DEVICE_TYPE(I80C32, i80c32_device)
DECLARE_DEVICE_TYPE(I80C52, i80c52_device)
DECLARE_DEVICE_TYPE(I87C52, i87c52_device)
DECLARE_DEVICE_TYPE(I87C51FA, i87c51fa_device)
DECLARE_DEVICE_TYPE(I80C51GB, i80c51gb_device)
DECLARE_DEVICE_TYPE(AT89C52, at89c52_device)
DECLARE_DEVICE_TYPE(AT89S52, at89s52_device)
DECLARE_DEVICE_TYPE(DS80C320, ds80c320_device)

#endif