Previous 199869 Revisions Next

r26799 Sunday 29th December, 2013 at 01:21:49 UTC by Barry Rodewald
x2212: added support for the 2210 (64x4)
[src/emu/machine]x2212.c x2212.h

trunk/src/emu/machine/x2212.c
r26798r26799
3030
3131// device type definition
3232const device_type X2212 = &device_creator<x2212_device>;
33const device_type X2210 = &device_creator<x2210_device>;
3334
3435//-------------------------------------------------
3536//  x2212_device - constructor
r26798r26799
4748{
4849}
4950
51x2212_device::x2212_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
52   : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
53      device_memory_interface(mconfig, *this),
54      device_nvram_interface(mconfig, *this),
55      m_auto_save(false),
56      m_sram_space_config("SRAM", ENDIANNESS_BIG, 8, 8, 0, *ADDRESS_MAP_NAME(x2212_sram_map)),
57      m_e2prom_space_config("E2PROM", ENDIANNESS_BIG, 8, 8, 0, *ADDRESS_MAP_NAME(x2212_e2prom_map)),
58      m_store(false),
59      m_array_recall(false)
60{
61}
5062
5163//-------------------------------------------------
5264//  static_set_auto_save - configuration helper
r26798r26799
7082
7183   m_sram = m_addrspace[0];
7284   m_e2prom = m_addrspace[1];
85
86   SIZE_DATA = 0x100;
7387}
7488
89void x2210_device::device_start()
90{
91   save_item(NAME(m_store));
92   save_item(NAME(m_array_recall));
7593
94   m_sram = m_addrspace[0];
95   m_e2prom = m_addrspace[1];
96
97   SIZE_DATA = 0x40;
98}
99
100
76101//-------------------------------------------------
77102//  memory_space_config - return a description of
78103//  any address spaces owned by this device
r26798r26799
225250      recall();
226251   m_array_recall = (state != 0);
227252}
253
254
255x2210_device::x2210_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
256   : x2212_device(mconfig, X2210, "X2210", tag, owner, clock, "x2210", __FILE__)
257{
258}
trunk/src/emu/machine/x2212.h
r26798r26799
2525   MCFG_DEVICE_ADD(_tag, X2212, 0) \
2626   x2212_device::static_set_auto_save(*device);
2727
28#define MCFG_X2210_ADD(_tag) \
29   MCFG_DEVICE_ADD(_tag, X2210, 0)
2830
31#define MCFG_X2210_ADD_AUTOSAVE(_tag) \
32   MCFG_DEVICE_ADD(_tag, X2210, 0) \
33   x2212_device::static_set_auto_save(*device);
34
35
2936//**************************************************************************
3037//  TYPE DEFINITIONS
3138//**************************************************************************
r26798r26799
4047public:
4148   // construction/destruction
4249   x2212_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
50   x2212_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
4351
4452   // inline configuration helpers
4553   static void static_set_auto_save(device_t &device);
r26798r26799
6775   virtual void nvram_read(emu_file &file);
6876   virtual void nvram_write(emu_file &file);
6977
70   static const int SIZE_DATA = 0x100;
78   int SIZE_DATA;
7179
7280   // configuration state
7381   bool                        m_auto_save;
r26798r26799
8492   bool        m_array_recall;
8593};
8694
95class x2210_device :    public x2212_device
96{
97public:
98   x2210_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
8799
100protected:
101   // device-level overrides
102   virtual void device_start();
103};
104
105
88106// device type definition
89107extern const device_type X2212;
108extern const device_type X2210;
90109
91110
92111#endif

Previous 199869 Revisions Next


© 1997-2024 The MAME Team