summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/bus/generic/ram.h
blob: 7d5637286f32ef5f5808724a1353b9751b28aa1a (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
// license:BSD-3-Clause
// copyright-holders:etabeta
#ifndef __GENERIC_RAM_H
#define __GENERIC_RAM_H

#include "slot.h"


// ======================> generic_ram_plain_device

class generic_ram_plain_device : public device_t,
							public device_generic_cart_interface
{
public:
	// construction/destruction
	generic_ram_plain_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 size, const char *shortname, const char *source);

	// device-level overrides
	virtual void device_start();

	// reading and writing
	virtual DECLARE_READ8_MEMBER(read_ram);
	virtual DECLARE_WRITE8_MEMBER(write_ram);

private:
	UINT32 m_size;
};


// ======================> generic_ram_linear_device

class generic_ram_linear_device : public device_t,
							public device_generic_cart_interface
{
public:
	// construction/destruction
	generic_ram_linear_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 size, const char *shortname, const char *source);

	// device-level overrides
	virtual void device_start();

	// reading and writing
	virtual DECLARE_READ8_MEMBER(read_ram);
	virtual DECLARE_WRITE8_MEMBER(write_ram);

private:
	UINT32 m_size;
};


// ======================> generic_ram_*k_plain_device

class generic_ram_32k_plain_device : public generic_ram_plain_device
{
public:
	// construction/destruction
	generic_ram_32k_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};

class generic_ram_64k_plain_device : public generic_ram_plain_device
{
public:
	// construction/destruction
	generic_ram_64k_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};

class generic_ram_128k_plain_device : public generic_ram_plain_device
{
public:
	// construction/destruction
	generic_ram_128k_plain_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};


// ======================> generic_ram_*k_linear_device

class generic_ram_32k_linear_device : public generic_ram_linear_device
{
public:
	// construction/destruction
	generic_ram_32k_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};

class generic_ram_64k_linear_device : public generic_ram_linear_device
{
public:
	// construction/destruction
	generic_ram_64k_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};

class generic_ram_128k_linear_device : public generic_ram_linear_device
{
public:
	// construction/destruction
	generic_ram_128k_linear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};



// device type definition
extern const device_type GENERIC_RAM_32K_PLAIN;
extern const device_type GENERIC_RAM_64K_PLAIN;
extern const device_type GENERIC_RAM_128K_PLAIN;
extern const device_type GENERIC_RAM_32K_LINEAR;
extern const device_type GENERIC_RAM_64K_LINEAR;
extern const device_type GENERIC_RAM_128K_LINEAR;


#endif