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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
// license:BSD-3-Clause
// copyright-holders:Nigel Barnes
/**********************************************************************
Solidisk Sideways RAM
http://chrisacorns.computinghistory.org.uk/8bit_Upgrades/Solidisk_128KSWE.html
**********************************************************************/
#include "emu.h"
#include "stlswr.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
DEFINE_DEVICE_TYPE(BBC_STLSWR16, bbc_stlswr16_device, "bbc_stlswr16", "Solidisk SWR16 - 16K Sideways RAM");
DEFINE_DEVICE_TYPE(BBC_STLSWR32, bbc_stlswr32_device, "bbc_stlswr32", "Solidisk SWR32 - 32K Sideways RAM");
DEFINE_DEVICE_TYPE(BBC_STLSWR64, bbc_stlswr64_device, "bbc_stlswr64", "Solidisk SWR64 - 64K Sideways RAM");
DEFINE_DEVICE_TYPE(BBC_STLSWR128, bbc_stlswr128_device, "bbc_stlswr128", "Solidisk SWR128 - 128K Sideways RAM");
//-------------------------------------------------
// ROM( stlswr )
//-------------------------------------------------
ROM_START(stlswr)
ROM_REGION(0x4000, "exp_rom", 0)
ROM_SYSTEM_BIOS(0, "13", "Toolkit 1.3 03/03/86")
ROMX_LOAD("toolkit-1.3-16k-128k-03-03-86.rom", 0x0000, 0x4000, CRC(a1745d10) SHA1(1821e74feca60b95766ead06df20f6db22e2b4bb), ROM_BIOS(0))
ROM_END
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
void bbc_stlswr16_device::device_add_mconfig(machine_config &config)
{
/* TODO: romslot3 is unavailable when board is fitted */
//config.device_remove(":romslot3");
BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, "ram").set_fixed_ram(true);
}
void bbc_stlswr32_device::device_add_mconfig(machine_config &config)
{
/* TODO: romslot3 is unavailable when board is fitted */
//config.device_remove(":romslot3");
BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, "ram").set_fixed_ram(true);
BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, "ram").set_fixed_ram(true);
}
void bbc_stlswr64_device::device_add_mconfig(machine_config &config)
{
/* TODO: romslot3 is unavailable when board is fitted */
//config.device_remove(":romslot3");
BBC_ROMSLOT16(config, m_rom[12], bbc_rom_devices, "ram").set_fixed_ram(true);
BBC_ROMSLOT16(config, m_rom[13], bbc_rom_devices, "ram").set_fixed_ram(true);
BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, "ram").set_fixed_ram(true);
BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, "ram").set_fixed_ram(true);
}
void bbc_stlswr128_device::device_add_mconfig(machine_config &config)
{
/* TODO: romslot3 is unavailable when board is fitted */
//config.device_remove(":romslot3");
BBC_ROMSLOT16(config, m_rom[8], bbc_rom_devices, "ram").set_fixed_ram(true);
BBC_ROMSLOT16(config, m_rom[9], bbc_rom_devices, "ram").set_fixed_ram(true);
BBC_ROMSLOT16(config, m_rom[10], bbc_rom_devices, "ram").set_fixed_ram(true);
BBC_ROMSLOT16(config, m_rom[11], bbc_rom_devices, "ram").set_fixed_ram(true);
BBC_ROMSLOT16(config, m_rom[12], bbc_rom_devices, "ram").set_fixed_ram(true);
BBC_ROMSLOT16(config, m_rom[13], bbc_rom_devices, "ram").set_fixed_ram(true);
BBC_ROMSLOT16(config, m_rom[14], bbc_rom_devices, "ram").set_fixed_ram(true);
BBC_ROMSLOT16(config, m_rom[15], bbc_rom_devices, "ram").set_fixed_ram(true);
}
//-------------------------------------------------
// rom_region - device-specific ROM region
//-------------------------------------------------
const tiny_rom_entry *bbc_stlswr_device::device_rom_region() const
{
return ROM_NAME(stlswr);
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// bbc_stlswr_device - constructor
//-------------------------------------------------
bbc_stlswr_device::bbc_stlswr_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
, device_bbc_internal_interface(mconfig, *this)
, m_rom(*this, "romslot%u", 0U)
{
}
bbc_stlswr16_device::bbc_stlswr16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: bbc_stlswr_device(mconfig, BBC_STLSWR16, tag, owner, clock)
{
}
bbc_stlswr32_device::bbc_stlswr32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: bbc_stlswr_device(mconfig, BBC_STLSWR32, tag, owner, clock)
{
}
bbc_stlswr64_device::bbc_stlswr64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: bbc_stlswr_device(mconfig, BBC_STLSWR64, tag, owner, clock)
{
}
bbc_stlswr128_device::bbc_stlswr128_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: bbc_stlswr_device(mconfig, BBC_STLSWR128, tag, owner, clock)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void bbc_stlswr_device::device_start()
{
/* register for save states */
save_item(NAME(m_romsel));
save_item(NAME(m_ramsel));
}
//**************************************************************************
// IMPLEMENTATION
//**************************************************************************
uint8_t bbc_stlswr_device::paged_r(offs_t offset)
{
uint8_t data = 0xff;
switch (m_romsel)
{
case 0: case 1: case 2: case 3:
/* motherboard rom sockets */
if (m_mb_rom[m_romsel] && m_mb_rom[m_romsel]->present())
{
data = m_mb_rom[m_romsel]->read(offset);
}
else
{
data = m_region_swr->base()[offset + (m_romsel << 14)];
}
break;
default:
/* expansion board sockets */
if (m_rom[m_romsel] && m_rom[m_romsel]->present())
{
data = m_rom[m_romsel]->read(offset);
}
else
{
data = m_region_swr->base()[offset + (m_romsel << 14)];
}
break;
}
return data;
}
void bbc_stlswr_device::paged_w(offs_t offset, uint8_t data)
{
switch (m_romsel)
{
case 0: case 1: case 2: case 3:
/* motherboard rom sockets */
if (m_mb_rom[m_romsel])
{
m_mb_rom[m_romsel]->write(offset, data);
}
break;
}
/* expansion board sockets */
if (m_rom[m_ramsel])
{
m_rom[m_ramsel]->write(offset, data);
}
}
|