From cbd26a090225658e1b68f136b444c1dff1c42ab5 Mon Sep 17 00:00:00 2001 From: mahlemiut Date: Sun, 29 Dec 2013 01:21:49 +0000 Subject: [PATCH] x2212: added support for the 2210 (64x4) --- src/emu/machine/x2212.c | 31 +++++++++++++++++++++++++++++++ src/emu/machine/x2212.h | 21 ++++++++++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/src/emu/machine/x2212.c b/src/emu/machine/x2212.c index 40469ce607c..89045a9a1cb 100644 --- a/src/emu/machine/x2212.c +++ b/src/emu/machine/x2212.c @@ -30,6 +30,7 @@ ADDRESS_MAP_END // device type definition const device_type X2212 = &device_creator; +const device_type X2210 = &device_creator; //------------------------------------------------- // x2212_device - constructor @@ -47,6 +48,17 @@ x2212_device::x2212_device(const machine_config &mconfig, const char *tag, devic { } +x2212_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) + : device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_memory_interface(mconfig, *this), + device_nvram_interface(mconfig, *this), + m_auto_save(false), + m_sram_space_config("SRAM", ENDIANNESS_BIG, 8, 8, 0, *ADDRESS_MAP_NAME(x2212_sram_map)), + m_e2prom_space_config("E2PROM", ENDIANNESS_BIG, 8, 8, 0, *ADDRESS_MAP_NAME(x2212_e2prom_map)), + m_store(false), + m_array_recall(false) +{ +} //------------------------------------------------- // static_set_auto_save - configuration helper @@ -70,6 +82,19 @@ void x2212_device::device_start() m_sram = m_addrspace[0]; m_e2prom = m_addrspace[1]; + + SIZE_DATA = 0x100; +} + +void x2210_device::device_start() +{ + save_item(NAME(m_store)); + save_item(NAME(m_array_recall)); + + m_sram = m_addrspace[0]; + m_e2prom = m_addrspace[1]; + + SIZE_DATA = 0x40; } @@ -225,3 +250,9 @@ WRITE_LINE_MEMBER( x2212_device::recall ) recall(); m_array_recall = (state != 0); } + + +x2210_device::x2210_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : x2212_device(mconfig, X2210, "X2210", tag, owner, clock, "x2210", __FILE__) +{ +} diff --git a/src/emu/machine/x2212.h b/src/emu/machine/x2212.h index 1370236696e..fbe7dfff259 100644 --- a/src/emu/machine/x2212.h +++ b/src/emu/machine/x2212.h @@ -25,6 +25,13 @@ MCFG_DEVICE_ADD(_tag, X2212, 0) \ x2212_device::static_set_auto_save(*device); +#define MCFG_X2210_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, X2210, 0) + +#define MCFG_X2210_ADD_AUTOSAVE(_tag) \ + MCFG_DEVICE_ADD(_tag, X2210, 0) \ + x2212_device::static_set_auto_save(*device); + //************************************************************************** // TYPE DEFINITIONS @@ -40,6 +47,7 @@ class x2212_device : public device_t, public: // construction/destruction x2212_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + 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); // inline configuration helpers static void static_set_auto_save(device_t &device); @@ -67,7 +75,7 @@ protected: virtual void nvram_read(emu_file &file); virtual void nvram_write(emu_file &file); - static const int SIZE_DATA = 0x100; + int SIZE_DATA; // configuration state bool m_auto_save; @@ -84,9 +92,20 @@ protected: bool m_array_recall; }; +class x2210_device : public x2212_device +{ +public: + x2210_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + // device-level overrides + virtual void device_start(); +}; + // device type definition extern const device_type X2212; +extern const device_type X2210; #endif