diff options
Diffstat (limited to 'src/devices/bus/adam/ram.cpp')
-rw-r--r-- | src/devices/bus/adam/ram.cpp | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/devices/bus/adam/ram.cpp b/src/devices/bus/adam/ram.cpp new file mode 100644 index 00000000000..6852de8959a --- /dev/null +++ b/src/devices/bus/adam/ram.cpp @@ -0,0 +1,72 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + Coleco Adam Internal 64KB RAM Expansion emulation + +**********************************************************************/ + +#include "ram.h" + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type ADAM_RAM = &device_creator<adam_ram_expansion_device>; + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// adam_ram_expansion_device - constructor +//------------------------------------------------- + +adam_ram_expansion_device::adam_ram_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, ADAM_RAM, "Adam 64KB RAM expansion", tag, owner, clock, "adam_ram", __FILE__), + device_adam_expansion_slot_card_interface(mconfig, *this), + m_ram(*this, "ram") +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void adam_ram_expansion_device::device_start() +{ + m_ram.allocate(0x10000); +} + + +//------------------------------------------------- +// adam_bd_r - buffered data read +//------------------------------------------------- + +UINT8 adam_ram_expansion_device::adam_bd_r(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) +{ + if (!cas2) + { + data = m_ram[offset]; + } + + return data; +} + + +//------------------------------------------------- +// adam_bd_w - buffered data write +//------------------------------------------------- + +void adam_ram_expansion_device::adam_bd_w(address_space &space, offs_t offset, UINT8 data, int bmreq, int biorq, int aux_rom_cs, int cas1, int cas2) +{ + if (!cas2) + { + m_ram[offset] = data; + } +} |