summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/apricot
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-09-13 08:41:44 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2015-09-13 08:41:44 +0200
commitf88cefad27a1737c76e09d99c9fb43e173506081 (patch)
tree2d8167d03579c46e226471747eb4407bd00ed6fa /src/devices/bus/apricot
parente92ac9e0fa8e99869894bea00589bbb526be30aa (diff)
Move all devices into separate part of src tree (nw)
Diffstat (limited to 'src/devices/bus/apricot')
-rw-r--r--src/devices/bus/apricot/cards.c15
-rw-r--r--src/devices/bus/apricot/cards.h19
-rw-r--r--src/devices/bus/apricot/expansion.c192
-rw-r--r--src/devices/bus/apricot/expansion.h208
-rw-r--r--src/devices/bus/apricot/ram.c177
-rw-r--r--src/devices/bus/apricot/ram.h89
6 files changed, 700 insertions, 0 deletions
diff --git a/src/devices/bus/apricot/cards.c b/src/devices/bus/apricot/cards.c
new file mode 100644
index 00000000000..9a97adffca6
--- /dev/null
+++ b/src/devices/bus/apricot/cards.c
@@ -0,0 +1,15 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ ACT Apricot Expansion Slot Devices
+
+***************************************************************************/
+
+#include "cards.h"
+
+SLOT_INTERFACE_START( apricot_expansion_cards )
+ SLOT_INTERFACE("128k", APRICOT_128K_RAM)
+ SLOT_INTERFACE("256k", APRICOT_256K_RAM)
+ SLOT_INTERFACE("512k", APRICOT_512K_RAM)
+SLOT_INTERFACE_END
diff --git a/src/devices/bus/apricot/cards.h b/src/devices/bus/apricot/cards.h
new file mode 100644
index 00000000000..67766d51a8e
--- /dev/null
+++ b/src/devices/bus/apricot/cards.h
@@ -0,0 +1,19 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ ACT Apricot Expansion Slot Devices
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __APRICOT_CARDS_H__
+#define __APRICOT_CARDS_H__
+
+#include "emu.h"
+#include "ram.h"
+
+SLOT_INTERFACE_EXTERN( apricot_expansion_cards );
+
+#endif // __APRICOT_CARDS_H__
diff --git a/src/devices/bus/apricot/expansion.c b/src/devices/bus/apricot/expansion.c
new file mode 100644
index 00000000000..7fe2b2a721c
--- /dev/null
+++ b/src/devices/bus/apricot/expansion.c
@@ -0,0 +1,192 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ ACT Apricot Expansion Slot
+
+***************************************************************************/
+
+#include "expansion.h"
+
+
+//**************************************************************************
+// EXPANSION SLOT DEVICE
+//**************************************************************************
+
+const device_type APRICOT_EXPANSION_SLOT = &device_creator<apricot_expansion_slot_device>;
+
+//-------------------------------------------------
+// apricot_expansion_slot_device - constructor
+//-------------------------------------------------
+
+apricot_expansion_slot_device::apricot_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, APRICOT_EXPANSION_SLOT, "Apricot Expansion Slot", tag, owner, clock, "apricot_exp_slot", __FILE__),
+ device_slot_interface(mconfig, *this)
+{
+}
+
+apricot_expansion_slot_device::apricot_expansion_slot_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_slot_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void apricot_expansion_slot_device::device_start()
+{
+ device_apricot_expansion_card_interface *dev = dynamic_cast<device_apricot_expansion_card_interface *>(get_card_device());
+
+ if (dev)
+ {
+ apricot_expansion_bus_device *bus = downcast<apricot_expansion_bus_device *>(m_owner);
+ bus->add_card(dev);
+ }
+}
+
+
+//**************************************************************************
+// EXPANSION BUS DEVICE
+//**************************************************************************
+
+const device_type APRICOT_EXPANSION_BUS = &device_creator<apricot_expansion_bus_device>;
+
+//-------------------------------------------------
+// apricot_expansion_bus_device - constructor
+//-------------------------------------------------
+
+apricot_expansion_bus_device::apricot_expansion_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, APRICOT_EXPANSION_BUS, "Apricot Expansion Bus", tag, owner, clock, "apricot_exp_bus", __FILE__),
+ m_program(NULL),
+ m_io(NULL),
+ m_program_iop(NULL),
+ m_io_iop(NULL),
+ m_dma1_handler(*this),
+ m_dma2_handler(*this),
+ m_ext1_handler(*this),
+ m_ext2_handler(*this),
+ m_int2_handler(*this),
+ m_int3_handler(*this)
+{
+}
+
+//-------------------------------------------------
+// apricot_expansion_bus_device - destructor
+//-------------------------------------------------
+
+apricot_expansion_bus_device::~apricot_expansion_bus_device()
+{
+ m_dev.detach_all();
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void apricot_expansion_bus_device::device_start()
+{
+ // resolve callbacks
+ m_dma1_handler.resolve_safe();
+ m_dma2_handler.resolve_safe();
+ m_ext1_handler.resolve_safe();
+ m_ext2_handler.resolve_safe();
+ m_int2_handler.resolve_safe();
+ m_int3_handler.resolve_safe();
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void apricot_expansion_bus_device::device_reset()
+{
+ cpu_device *cpu = m_owner->subdevice<cpu_device>(m_cpu_tag);
+ m_program = &cpu->space(AS_PROGRAM);
+ m_io = &cpu->space(AS_IO);
+
+ cpu_device *iop = m_owner->subdevice<cpu_device>(m_iop_tag);
+ m_program_iop = &iop->space(AS_PROGRAM);
+ m_io_iop = &iop->space(AS_IO);
+}
+
+//-------------------------------------------------
+// add_card - add new card to our bus
+//-------------------------------------------------
+
+void apricot_expansion_bus_device::add_card(device_apricot_expansion_card_interface *card)
+{
+ card->set_bus_device(this);
+ m_dev.append(*card);
+}
+
+//-------------------------------------------------
+// set_cpu_tag - set cpu we are attached to
+//-------------------------------------------------
+
+void apricot_expansion_bus_device::set_cpu_tag(device_t &device, device_t *owner, const char *tag)
+{
+ apricot_expansion_bus_device &bus = dynamic_cast<apricot_expansion_bus_device &>(device);
+ bus.m_cpu_tag = tag;
+}
+
+//-------------------------------------------------
+// set_iop_tag - set iop we are attached to
+//-------------------------------------------------
+
+void apricot_expansion_bus_device::set_iop_tag(device_t &device, device_t *owner, const char *tag)
+{
+ apricot_expansion_bus_device &bus = dynamic_cast<apricot_expansion_bus_device &>(device);
+ bus.m_iop_tag = tag;
+}
+
+// callbacks from slot device to the host
+WRITE_LINE_MEMBER( apricot_expansion_bus_device::dma1_w ) { m_dma1_handler(state); }
+WRITE_LINE_MEMBER( apricot_expansion_bus_device::dma2_w ) { m_dma2_handler(state); }
+WRITE_LINE_MEMBER( apricot_expansion_bus_device::ext1_w ) { m_ext1_handler(state); }
+WRITE_LINE_MEMBER( apricot_expansion_bus_device::ext2_w ) { m_ext2_handler(state); }
+WRITE_LINE_MEMBER( apricot_expansion_bus_device::int2_w ) { m_int2_handler(state); }
+WRITE_LINE_MEMBER( apricot_expansion_bus_device::int3_w ) { m_int3_handler(state); }
+
+//-------------------------------------------------
+// install_ram - attach ram to cpu/iop
+//-------------------------------------------------
+
+void apricot_expansion_bus_device::install_ram(offs_t addrstart, offs_t addrend, void *baseptr)
+{
+ m_program->install_ram(addrstart, addrend, baseptr);
+
+ if (m_program_iop)
+ m_program_iop->install_ram(addrstart, addrend, baseptr);
+}
+
+
+//**************************************************************************
+// CARTRIDGE INTERFACE
+//**************************************************************************
+
+//-------------------------------------------------
+// device_apricot_expansion_card_interface - constructor
+//-------------------------------------------------
+
+device_apricot_expansion_card_interface::device_apricot_expansion_card_interface(const machine_config &mconfig, device_t &device) :
+ device_slot_card_interface(mconfig, device),
+ m_next(NULL),
+ m_bus(NULL)
+{
+}
+
+//-------------------------------------------------
+// ~device_apricot_expansion_card_interface - destructor
+//-------------------------------------------------
+
+device_apricot_expansion_card_interface::~device_apricot_expansion_card_interface()
+{
+}
+
+void device_apricot_expansion_card_interface::set_bus_device(apricot_expansion_bus_device *bus)
+{
+ m_bus = bus;
+}
diff --git a/src/devices/bus/apricot/expansion.h b/src/devices/bus/apricot/expansion.h
new file mode 100644
index 00000000000..38687db4399
--- /dev/null
+++ b/src/devices/bus/apricot/expansion.h
@@ -0,0 +1,208 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ ACT Apricot Expansion Slot
+
+ A B
+
+ -12V 32 +12V
+ +5V 31 +5V
+ DB0 30 DB1
+ DB2 29 DB3
+ DB4 28 DB5
+ DB6 27 DB7
+ AB10 26 AB9
+ AB11 25 AB12
+ /AMWC 24 /MRDC
+ /DMA2 23 DT/R
+ /DMA1 22 /IORC
+ /MWTC 21 /RES
+ /IOWC 20 /AIOWC
+ GND 19 GND
+ /CLK5 18 DEN
+ /IRDY 17 /MRDY
+ /EXT1 16 /EXT2
+ /INT3 15 /ALE
+ AB6 14 /INT2
+ AB8 13 AB7
+ DB9 12 DB8
+ DB11 11 DB10
+ DB13 10 DB12
+ DB15 9 DB14
+ AB2 8 AB1
+ AB4 7 AB3
+ AB0 6 AB5
+ AB14 5 AB13
+ AB15 4 AB16
+ AB17 3 AB18
+ AB19 2 /BHE
+ NMI 1 CLK15
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __APRICOT_EXPANSION_H__
+#define __APRICOT_EXPANSION_H__
+
+#include "emu.h"
+
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_EXPANSION_ADD(_tag, _cpu_tag) \
+ MCFG_DEVICE_ADD(_tag, APRICOT_EXPANSION_BUS, 0) \
+ apricot_expansion_bus_device::set_cpu_tag(*device, owner, _cpu_tag);
+
+#define MCFG_EXPANSION_IOP_ADD(_tag) \
+ apricot_expansion_bus_device::set_iop_tag(*device, owner, _tag);
+
+#define MCFG_EXPANSION_SLOT_ADD(_tag, _slot_intf, _def_slot) \
+ MCFG_DEVICE_ADD(_tag, APRICOT_EXPANSION_SLOT, 0) \
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
+
+#define MCFG_EXPANSION_DMA1_HANDLER(_devcb) \
+ devcb = &apricot_expansion_bus_device::set_dma1_handler(*device, DEVCB_##_devcb);
+
+#define MCFG_EXPANSION_DMA2_HANDLER(_devcb) \
+ devcb = &apricot_expansion_bus_device::set_dma2_handler(*device, DEVCB_##_devcb);
+
+#define MCFG_EXPANSION_EXT1_HANDLER(_devcb) \
+ devcb = &apricot_expansion_bus_device::set_ext1_handler(*device, DEVCB_##_devcb);
+
+#define MCFG_EXPANSION_EXT2_HANDLER(_devcb) \
+ devcb = &apricot_expansion_bus_device::set_ext2_handler(*device, DEVCB_##_devcb);
+
+#define MCFG_EXPANSION_INT2_HANDLER(_devcb) \
+ devcb = &apricot_expansion_bus_device::set_int2_handler(*device, DEVCB_##_devcb);
+
+#define MCFG_EXPANSION_INT3_HANDLER(_devcb) \
+ devcb = &apricot_expansion_bus_device::set_int3_handler(*device, DEVCB_##_devcb);
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// forward declaration
+class device_apricot_expansion_card_interface;
+
+
+// ======================> apricot_expansion_slot_device
+
+class apricot_expansion_slot_device : public device_t, public device_slot_interface
+{
+public:
+ // construction/destruction
+ apricot_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ apricot_expansion_slot_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-level overrides
+ virtual void device_start();
+};
+
+// device type definition
+extern const device_type APRICOT_EXPANSION_SLOT;
+
+
+// ======================> apricot_expansion_bus_device
+
+class apricot_expansion_bus_device : public device_t
+{
+public:
+ // construction/destruction
+ apricot_expansion_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ virtual ~apricot_expansion_bus_device();
+
+ template<class _Object> static devcb_base &set_dma1_handler(device_t &device, _Object object)
+ { return downcast<apricot_expansion_bus_device &>(device).m_dma1_handler.set_callback(object); }
+
+ template<class _Object> static devcb_base &set_dma2_handler(device_t &device, _Object object)
+ { return downcast<apricot_expansion_bus_device &>(device).m_dma2_handler.set_callback(object); }
+
+ template<class _Object> static devcb_base &set_ext1_handler(device_t &device, _Object object)
+ { return downcast<apricot_expansion_bus_device &>(device).m_ext1_handler.set_callback(object); }
+
+ template<class _Object> static devcb_base &set_ext2_handler(device_t &device, _Object object)
+ { return downcast<apricot_expansion_bus_device &>(device).m_ext2_handler.set_callback(object); }
+
+ template<class _Object> static devcb_base &set_int2_handler(device_t &device, _Object object)
+ { return downcast<apricot_expansion_bus_device &>(device).m_int2_handler.set_callback(object); }
+
+ template<class _Object> static devcb_base &set_int3_handler(device_t &device, _Object object)
+ { return downcast<apricot_expansion_bus_device &>(device).m_int3_handler.set_callback(object); }
+
+ // inline configuration
+ static void set_cpu_tag(device_t &device, device_t *owner, const char *tag);
+ static void set_iop_tag(device_t &device, device_t *owner, const char *tag);
+
+ void add_card(device_apricot_expansion_card_interface *card);
+
+ // from cards
+ DECLARE_WRITE_LINE_MEMBER( dma1_w );
+ DECLARE_WRITE_LINE_MEMBER( dma2_w );
+ DECLARE_WRITE_LINE_MEMBER( ext1_w );
+ DECLARE_WRITE_LINE_MEMBER( ext2_w );
+ DECLARE_WRITE_LINE_MEMBER( int2_w );
+ DECLARE_WRITE_LINE_MEMBER( int3_w );
+
+ void install_ram(offs_t addrstart, offs_t addrend, void *baseptr);
+
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+
+private:
+ simple_list<device_apricot_expansion_card_interface> m_dev;
+
+ // address spaces we have access to
+ address_space *m_program;
+ address_space *m_io;
+ address_space *m_program_iop;
+ address_space *m_io_iop;
+
+ devcb_write_line m_dma1_handler;
+ devcb_write_line m_dma2_handler;
+ devcb_write_line m_ext1_handler;
+ devcb_write_line m_ext2_handler;
+ devcb_write_line m_int2_handler;
+ devcb_write_line m_int3_handler;
+
+ // configuration
+ const char *m_cpu_tag;
+ const char *m_iop_tag;
+};
+
+// device type definition
+extern const device_type APRICOT_EXPANSION_BUS;
+
+
+// ======================> device_apricot_expansion_card_interface
+
+class device_apricot_expansion_card_interface : public device_slot_card_interface
+{
+public:
+ // construction/destruction
+ device_apricot_expansion_card_interface(const machine_config &mconfig, device_t &device);
+ virtual ~device_apricot_expansion_card_interface();
+
+ void set_bus_device(apricot_expansion_bus_device *bus);
+
+ device_apricot_expansion_card_interface *next() const { return m_next; }
+ device_apricot_expansion_card_interface *m_next;
+
+protected:
+ apricot_expansion_bus_device *m_bus;
+};
+
+
+// include here so drivers don't need to
+#include "cards.h"
+
+
+#endif // __APRICOT_EXPANSION_H__
diff --git a/src/devices/bus/apricot/ram.c b/src/devices/bus/apricot/ram.c
new file mode 100644
index 00000000000..2221ae37227
--- /dev/null
+++ b/src/devices/bus/apricot/ram.c
@@ -0,0 +1,177 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ ACT Apricot RAM Expansions
+
+***************************************************************************/
+
+#include "ram.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type APRICOT_256K_RAM = &device_creator<apricot_256k_ram_device>;
+const device_type APRICOT_128K_RAM = &device_creator<apricot_128k_ram_device>;
+const device_type APRICOT_512K_RAM = &device_creator<apricot_512k_ram_device>;
+
+
+//**************************************************************************
+// APRICOT 256K RAM DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+static INPUT_PORTS_START( apricot_256k )
+ PORT_START("sw")
+ PORT_DIPNAME(0x01, 0x00, "Base Address")
+ PORT_DIPSETTING(0x00, "40000H")
+ PORT_DIPSETTING(0x01, "80000H")
+INPUT_PORTS_END
+
+ioport_constructor apricot_256k_ram_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( apricot_256k );
+}
+
+//-------------------------------------------------
+// apricot_256k_ram_device - constructor
+//-------------------------------------------------
+
+apricot_256k_ram_device::apricot_256k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, APRICOT_256K_RAM, "Apricot 256K RAM Expansion Board", tag, owner, clock, "apricot_256k_ram", __FILE__),
+ device_apricot_expansion_card_interface(mconfig, *this),
+ m_sw(*this, "sw")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void apricot_256k_ram_device::device_start()
+{
+ m_ram.resize(0x40000 / 2);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void apricot_256k_ram_device::device_reset()
+{
+ if (m_sw->read() == 0)
+ m_bus->install_ram(0x40000, 0x7ffff, &m_ram[0]);
+ else
+ m_bus->install_ram(0x80000, 0xbffff, &m_ram[0]);
+}
+
+
+//**************************************************************************
+// APRICOT 128K RAM DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+static INPUT_PORTS_START( apricot_128k )
+ PORT_START("strap")
+ PORT_DIPNAME(0x03, 0x01, "Base Address")
+ PORT_DIPSETTING(0x00, "512K")
+ PORT_DIPSETTING(0x01, "256K - 384K")
+ PORT_DIPSETTING(0x02, "384K - 512K")
+INPUT_PORTS_END
+
+ioport_constructor apricot_128k_ram_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( apricot_128k );
+}
+
+//-------------------------------------------------
+// apricot_128_512k_ram_device - constructor
+//-------------------------------------------------
+
+apricot_128k_ram_device::apricot_128k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, APRICOT_128K_RAM, "Apricot 128/512K RAM Expansion Board (128K)", tag, owner, clock, "apricot_128k_ram", __FILE__),
+ device_apricot_expansion_card_interface(mconfig, *this),
+ m_strap(*this, "strap")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void apricot_128k_ram_device::device_start()
+{
+ m_ram.resize(0x20000 / 2);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void apricot_128k_ram_device::device_reset()
+{
+ if (m_strap->read() == 1)
+ m_bus->install_ram(0x40000, 0x5ffff, &m_ram[0]);
+ else if (m_strap->read() == 2)
+ m_bus->install_ram(0x60000, 0x7ffff, &m_ram[0]);
+}
+
+
+//**************************************************************************
+// APRICOT 512K RAM DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+static INPUT_PORTS_START( apricot_512k )
+ PORT_START("strap")
+ PORT_DIPNAME(0x03, 0x00, "Base Address")
+ PORT_DIPSETTING(0x00, "512K")
+ PORT_DIPSETTING(0x01, "256K - 384K")
+ PORT_DIPSETTING(0x02, "384K - 512K")
+INPUT_PORTS_END
+
+ioport_constructor apricot_512k_ram_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( apricot_512k );
+}
+
+//-------------------------------------------------
+// apricot_128_512k_ram_device - constructor
+//-------------------------------------------------
+
+apricot_512k_ram_device::apricot_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, APRICOT_512K_RAM, "Apricot 128/512K RAM Expansion Board (512K)", tag, owner, clock, "apricot_512k_ram", __FILE__),
+ device_apricot_expansion_card_interface(mconfig, *this),
+ m_strap(*this, "strap")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void apricot_512k_ram_device::device_start()
+{
+ m_ram.resize(0x80000 / 2);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void apricot_512k_ram_device::device_reset()
+{
+ if (m_strap->read() == 0)
+ m_bus->install_ram(0x40000, 0xbffff, &m_ram[0]);
+}
diff --git a/src/devices/bus/apricot/ram.h b/src/devices/bus/apricot/ram.h
new file mode 100644
index 00000000000..20ac01f2867
--- /dev/null
+++ b/src/devices/bus/apricot/ram.h
@@ -0,0 +1,89 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ ACT Apricot RAM Expansions
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __APRICOT_RAM__
+#define __APRICOT_RAM__
+
+#include "emu.h"
+#include "expansion.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+
+// ======================> apricot_256k_ram_device
+
+class apricot_256k_ram_device : public device_t, public device_apricot_expansion_card_interface
+{
+public:
+ // construction/destruction
+ apricot_256k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ virtual ioport_constructor device_input_ports() const;
+ virtual void device_start();
+ virtual void device_reset();
+
+private:
+ required_ioport m_sw;
+
+ std::vector<UINT16> m_ram;
+};
+
+
+// ======================> apricot_128k_ram_device
+
+class apricot_128k_ram_device : public device_t, public device_apricot_expansion_card_interface
+{
+public:
+ // construction/destruction
+ apricot_128k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ virtual ioport_constructor device_input_ports() const;
+ virtual void device_start();
+ virtual void device_reset();
+
+private:
+ required_ioport m_strap;
+
+ std::vector<UINT16> m_ram;
+};
+
+
+// ======================> apricot_512k_ram_device
+
+class apricot_512k_ram_device : public device_t, public device_apricot_expansion_card_interface
+{
+public:
+ // construction/destruction
+ apricot_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ virtual ioport_constructor device_input_ports() const;
+ virtual void device_start();
+ virtual void device_reset();
+
+private:
+ required_ioport m_strap;
+
+ std::vector<UINT16> m_ram;
+};
+
+
+// device type definition
+extern const device_type APRICOT_256K_RAM;
+extern const device_type APRICOT_128K_RAM;
+extern const device_type APRICOT_512K_RAM;
+
+
+#endif // __APRICOT_RAM__