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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
// license:GPL-2.0+
// copyright-holders:Dirk Best
/***************************************************************************
ACT Apricot RAM Expansions
***************************************************************************/
#include "emu.h"
#include "ram.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
DEFINE_DEVICE_TYPE(APRICOT_256K_RAM, apricot_256k_ram_device, "apricot_256k_ram", "Apricot 256K RAM Expansion Board")
DEFINE_DEVICE_TYPE(APRICOT_128K_RAM, apricot_128k_ram_device, "apricot_128k_ram", "Apricot 128K/512K RAM Expansion Board (128K)")
DEFINE_DEVICE_TYPE(APRICOT_512K_RAM, apricot_512k_ram_device, "apricot_512k_ram", "Apricot 128K/512K RAM Expansion Board (512K)")
//**************************************************************************
// 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, const XTAL &clock) :
device_t(mconfig, APRICOT_256K_RAM, tag, owner, clock),
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, const XTAL &clock) :
device_t(mconfig, APRICOT_128K_RAM, tag, owner, clock),
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, const XTAL &clock) :
device_t(mconfig, APRICOT_512K_RAM, tag, owner, clock),
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]);
}
|