summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/x28.h
blob: 4b97251bc6ac571390268d40e7c021c21b15f880 (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
// license:BSD-3-Clause
// copyright-holders:Christian Brunschen
/***************************************************************************

  Xicor 28-series Parallel EEPROMs

***************************************************************************/

#ifndef MAME_MACHINE_X28_H
#define MAME_MACHINE_X28_H

#pragma once

#include "eeprom28.h"

// Concrete devices

#define DECLARE_X28_DEVICES_AND_TYPES(Type, Class, AddrBits, PageBytes, TBLC, TWC, ...)                      \
/* Device Type - includes a forward declaration of the Class */                                              \
DECLARE_DEVICE_TYPE(Type, Class##_device)                                                                    \
/* The Class, which can now refer to the Device Type when calling the superclass's constructor */            \
class Class##_device                                                                                         \
: public eeprom28_device<AddrBits, PageBytes, TBLC, TWC __VA_OPT__(,) __VA_ARGS__>                          \
{                                                                                                            \
public:                                                                                                      \
	Class##_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0)        \
	: eeprom28_device(mconfig, Type, tag, owner, clock) { }                                                    \
};                                                                                                           \
/* Device Type - includes a forward declaration of the Class */                                              \
DECLARE_DEVICE_TYPE(Type##_NVRAM, Class##_nvram_device)                                                      \
/* The Class, which can now refer to the Device Type when calling the superclass's constructor */            \
class Class##_nvram_device                                                                                   \
: public eeprom28_nvram_device<AddrBits, PageBytes, TBLC, TWC __VA_OPT__(,) __VA_ARGS__>                     \
{                                                                                                            \
public:                                                                                                      \
	Class##_nvram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0)  \
	: eeprom28_nvram_device(mconfig, Type##_NVRAM, tag, owner, clock) { }                                      \
};

// X28C64: 64kbit == 8k bytes, 64 bytes per page
DECLARE_X28_DEVICES_AND_TYPES(X28C64, x28c64, 13, 64, 100, 5000)

// X28C256: 256kbit == 32k bytes, 64 bytes per page
DECLARE_X28_DEVICES_AND_TYPES(X28C256, x28c256, 15, 64, 100, 5000)

// X28HC256: 256kbit == 32k bytes, 64 bytes per page, T_WC = 3 ms.
DECLARE_X28_DEVICES_AND_TYPES(X28HC256, x28hc256, 15, 64, 100, 3000)

// X28C512: 512kbit == 64k bytes, 128 bytes per page
DECLARE_X28_DEVICES_AND_TYPES(X28C512, x28c512, 16, 128, 100, 5000)

// X28C010: 1Mbit = 128k bytes, 256 bytes per page
DECLARE_X28_DEVICES_AND_TYPES(X28C010, x28c010, 17, 256, 100, 5000)

// XM28C020: 2Mbit = 256 kbytes, 128 bytes per page;
// comprised of 4 X28C513LCC:s on a single substrate
DECLARE_X28_DEVICES_AND_TYPES(XM28C020, xm28c020, 18, 128, 100, 5000)

// XM28C040: 4Mbit = 512 kbytes, 256 bytes per page;
// comprised of 4 X28C010:s on a single substrate
DECLARE_X28_DEVICES_AND_TYPES(XM28C040, xm28c040, 19, 256, 100, 5000)

#undef DECLARE_X28_DEVICES_AND_TYPES

#endif // MAME_MACHINE_X28_H