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
|
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/**********************************************************************
Atari Portfolio 128KB RAM card emulation
**********************************************************************/
#include "emu.h"
#include "ram.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
DEFINE_DEVICE_TYPE(PORTFOLIO_RAM_CARD, portfolio_ram_card_device, "portfolio_ram_card", "Atari Portfolio RAM card")
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// portfolio_ram_card_device - constructor
//-------------------------------------------------
portfolio_ram_card_device::portfolio_ram_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PORTFOLIO_RAM_CARD, tag, owner, clock),
device_portfolio_memory_card_slot_interface(mconfig, *this),
device_nvram_interface(mconfig, *this)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void portfolio_ram_card_device::device_start()
{
m_nvram.allocate(0x20000);
}
//-------------------------------------------------
// nrdi_r - read
//-------------------------------------------------
uint8_t portfolio_ram_card_device::nrdi_r(address_space &space, offs_t offset)
{
return m_nvram[offset];
}
//-------------------------------------------------
// nwri_w - write
//-------------------------------------------------
void portfolio_ram_card_device::nwri_w(address_space &space, offs_t offset, uint8_t data)
{
m_nvram[offset] = data;
}
|