summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/segacrp2_device.h
blob: a64f3fa5fe0bf718ac5ea854f12aec3192df5f63 (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// license:BSD-3-Clause
// copyright-holders:David Haywood
#ifndef MAME_MACHINE_SEGACRP2_DEVICE_H
#define MAME_MACHINE_SEGACRP2_DEVICE_H

#pragma once


#include "cpu/z80/z80.h"

// base class
class segacrp2_z80_device : public z80_device
{
public:
	template <typename T> void set_decrypted_tag(T &&decrypted_tag) { m_decrypted.set_tag(std::forward<T>(decrypted_tag)); }

protected:
	segacrp2_z80_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);

	virtual void device_start() override;
	virtual void decrypt() = 0;

	required_shared_ptr<uint8_t> m_decrypted;
};



// actual encrypted CPUs
class nec_315_5136_device : public segacrp2_z80_device
{
public:
	nec_315_5136_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t);
protected:
	virtual void decrypt() override;
};

class sega_315_5179_device : public segacrp2_z80_device
{
public:
	sega_315_5179_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t);
protected:
	virtual void decrypt() override;
};


class sega_315_5178_device : public segacrp2_z80_device
{
public:
	sega_315_5178_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t);
protected:
	virtual void decrypt() override;
};

class sega_315_5177_device : public segacrp2_z80_device
{
public:
	sega_315_5177_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t);
protected:
	virtual void decrypt() override;
};

class sega_315_5176_device : public segacrp2_z80_device
{
public:
	sega_315_5176_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t);
protected:
	virtual void decrypt() override;
};

class sega_315_5162_device : public segacrp2_z80_device
{
public:
	sega_315_5162_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t);
protected:
	virtual void decrypt() override;
};

class sega_317_0004_device : public segacrp2_z80_device
{
public:
	sega_317_0004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t);
protected:
	virtual void decrypt() override;
};


class sega_317_0005_device : public segacrp2_z80_device
{
public:
	sega_317_0005_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t);
protected:
	virtual void decrypt() override;
};


class sega_317_0006_device : public segacrp2_z80_device
{
public:
	sega_317_0006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t);
protected:
	virtual void decrypt() override;
};

class sega_317_0007_device : public segacrp2_z80_device
{
public:
	sega_317_0007_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t);
protected:
	virtual void decrypt() override;
};


DECLARE_DEVICE_TYPE(NEC_315_5136,  nec_315_5136_device)
DECLARE_DEVICE_TYPE(SEGA_315_5179, sega_315_5179_device)
DECLARE_DEVICE_TYPE(SEGA_315_5178, sega_315_5178_device)
DECLARE_DEVICE_TYPE(SEGA_315_5177, sega_315_5177_device)
DECLARE_DEVICE_TYPE(SEGA_315_5176, sega_315_5176_device)
DECLARE_DEVICE_TYPE(SEGA_315_5162, sega_315_5162_device)

DECLARE_DEVICE_TYPE(SEGA_317_0004, sega_317_0004_device)
DECLARE_DEVICE_TYPE(SEGA_317_0005, sega_317_0005_device)
DECLARE_DEVICE_TYPE(SEGA_317_0006, sega_317_0006_device)
DECLARE_DEVICE_TYPE(SEGA_317_0007, sega_317_0007_device)


#endif // MAME_MACHINE_SEGACRP2_DEVICE_H