summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/abcbus/abc890.cpp
blob: 27530439929e9beae41a413b3f871a48303d53af (plain) (blame)
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/**********************************************************************

    Luxor ABC 890 bus expander emulation

*********************************************************************/

#include "emu.h"
#include "abc890.h"



//**************************************************************************
//  DEVICE DEFINITIONS
//**************************************************************************

DEFINE_DEVICE_TYPE(ABC_EXPANSION_UNIT, abc_expansion_unit_device, "abcexp", "ABC Expansion Unit")
DEFINE_DEVICE_TYPE(ABC890,             abc890_device,             "abc890", "ABC 890")
DEFINE_DEVICE_TYPE(ABC894,             abc894_device,             "abc894", "ABC 894")
DEFINE_DEVICE_TYPE(ABC850,             abc850_device,             "abc850", "ABC 850")
DEFINE_DEVICE_TYPE(ABC852,             abc852_device,             "abc852", "ABC 852")
DEFINE_DEVICE_TYPE(ABC856,             abc856_device,             "abc856", "ABC 856")


//-------------------------------------------------
//  device_add_mconfig - add device configuration
//-------------------------------------------------

void abc890_device::device_add_mconfig(machine_config &config)
{
	ABCBUS_SLOT(config, "io1", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io2", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io3", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io4", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "mem1", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "mem2", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "mem3", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
}


//-------------------------------------------------
//  device_add_mconfig - add device configuration
//-------------------------------------------------

void abc_expansion_unit_device::device_add_mconfig(machine_config &config)
{
	ABCBUS_SLOT(config, "io1", DERIVED_CLOCK(1, 1), abc80_cards, "abc830");
	ABCBUS_SLOT(config, "io2", DERIVED_CLOCK(1, 1), abc80_cards, nullptr);
	ABCBUS_SLOT(config, "io3", DERIVED_CLOCK(1, 1), abc80_cards, nullptr);
	ABCBUS_SLOT(config, "io4", DERIVED_CLOCK(1, 1), abc80_cards, nullptr);
	ABCBUS_SLOT(config, "mem1", DERIVED_CLOCK(1, 1), abc80_cards, "memcard");
	ABCBUS_SLOT(config, "mem2", DERIVED_CLOCK(1, 1), abc80_cards, "16k");
	ABCBUS_SLOT(config, "mem3", DERIVED_CLOCK(1, 1), abc80_cards, nullptr);
}


//-------------------------------------------------
//  device_add_mconfig - add device configuration
//-------------------------------------------------

void abc894_device::device_add_mconfig(machine_config &config)
{
	ABCBUS_SLOT(config, "io1", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io2", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io3", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
}


//-------------------------------------------------
//  device_add_mconfig - add device configuration
//-------------------------------------------------

void abc850_device::device_add_mconfig(machine_config &config)
{
	ABCBUS_SLOT(config, "io1", DERIVED_CLOCK(1, 1), abcbus_cards, "abc850fdd");
	ABCBUS_SLOT(config, "io2", DERIVED_CLOCK(1, 1), abcbus_cards, "xebec")
		.set_option_default_bios("xebec", "ro202");
	ABCBUS_SLOT(config, "io3", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io4", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io5", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io6", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io7", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
}


//-------------------------------------------------
//  device_add_mconfig - add device configuration
//-------------------------------------------------

void abc852_device::device_add_mconfig(machine_config &config)
{
	ABCBUS_SLOT(config, "io1", DERIVED_CLOCK(1, 1), abcbus_cards, "abc850fdd");
	ABCBUS_SLOT(config, "io2", DERIVED_CLOCK(1, 1), abcbus_cards, "xebec")
		.set_option_default_bios("xebec", "basf6185");
	ABCBUS_SLOT(config, "io3", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io4", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io5", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io6", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io7", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
}


//-------------------------------------------------
//  device_add_mconfig - add device configuration
//-------------------------------------------------

void abc856_device::device_add_mconfig(machine_config &config)
{
	ABCBUS_SLOT(config, "io1", DERIVED_CLOCK(1, 1), abcbus_cards, "abc850fdd");
	ABCBUS_SLOT(config, "io2", DERIVED_CLOCK(1, 1), abcbus_cards, "xebec")
		.set_option_default_bios("xebec", "micr1325");
	ABCBUS_SLOT(config, "io3", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io4", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io5", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io6", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
	ABCBUS_SLOT(config, "io7", DERIVED_CLOCK(1, 1), abcbus_cards, nullptr);
}



//**************************************************************************
//  LIVE DEVICE
//**************************************************************************

//-------------------------------------------------
//  abc890_device - constructor
//-------------------------------------------------

abc890_device::abc890_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_abcbus_card_interface(mconfig, *this)
{
}

abc890_device::abc890_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
	abc890_device(mconfig, ABC890, tag, owner, clock)
{
}

abc_expansion_unit_device::abc_expansion_unit_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
	abc890_device(mconfig, ABC_EXPANSION_UNIT, tag, owner, clock)
{
}

abc894_device::abc894_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
	abc890_device(mconfig, ABC894, tag, owner, clock)
{
}

abc850_device::abc850_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
	abc890_device(mconfig, ABC850, tag, owner, clock)
{
}

abc852_device::abc852_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
	abc890_device(mconfig, ABC852, tag, owner, clock)
{
}

abc856_device::abc856_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
	abc890_device(mconfig, ABC856, tag, owner, clock)
{
}


//-------------------------------------------------
//  device_start - device-specific startup
//-------------------------------------------------

void abc890_device::device_start()
{
}


//-------------------------------------------------
//  device_reset - device-specific reset
//-------------------------------------------------

void abc890_device::device_reset()
{
	for (device_t &device : subdevices())
	{
		device.reset();
	}
}


//-------------------------------------------------
//  abcbus_cs - card select
//-------------------------------------------------

void abc890_device::abcbus_cs(uint8_t data)
{
	for (abcbus_slot_device &slot : abcbus_slot_device_iterator(*this))
		slot.write_cs(data);
}


//-------------------------------------------------
//  abcbus_inp - input
//-------------------------------------------------

uint8_t abc890_device::abcbus_inp()
{
	uint8_t data = 0xff;

	for (abcbus_slot_device &slot : abcbus_slot_device_iterator(*this))
		data &= slot.read_inp();

	return data;
}


//-------------------------------------------------
//  abcbus_out - output
//-------------------------------------------------

void abc890_device::abcbus_out(uint8_t data)
{
	for (abcbus_slot_device &slot : abcbus_slot_device_iterator(*this))
		slot.write_out(data);
}


//-------------------------------------------------
//  abcbus_stat - status
//-------------------------------------------------

uint8_t abc890_device::abcbus_stat()
{
	uint8_t data = 0xff;

	for (abcbus_slot_device &slot : abcbus_slot_device_iterator(*this))
		data &= slot.read_stat();

	return data;
}


//-------------------------------------------------
//  abcbus_c1 - command 1
//-------------------------------------------------

void abc890_device::abcbus_c1(uint8_t data)
{
	for (abcbus_slot_device &slot : abcbus_slot_device_iterator(*this))
		slot.write_c1(data);
}


//-------------------------------------------------
//  abcbus_c2 - command 2
//-------------------------------------------------

void abc890_device::abcbus_c2(uint8_t data)
{
	for (abcbus_slot_device &slot : abcbus_slot_device_iterator(*this))
		slot.write_c2(data);
}


//-------------------------------------------------
//  abcbus_c3 - command 3
//-------------------------------------------------

void abc890_device::abcbus_c3(uint8_t data)
{
	for (abcbus_slot_device &slot : abcbus_slot_device_iterator(*this))
		slot.write_c3(data);
}


//-------------------------------------------------
//  abcbus_c4 - command 4
//-------------------------------------------------

void abc890_device::abcbus_c4(uint8_t data)
{
	for (abcbus_slot_device &slot : abcbus_slot_device_iterator(*this))
		slot.write_c4(data);
}


//-------------------------------------------------
//  abcbus_xmemfl - extended memory read
//-------------------------------------------------

uint8_t abc890_device::abcbus_xmemfl(offs_t offset)
{
	uint8_t data = 0xff;

	for (abcbus_slot_device &slot : abcbus_slot_device_iterator(*this))
	{
		data &= slot.xmemfl_r(offset);
	}

	return data;
}


//-------------------------------------------------
//  abcbus_xmemw - extended memory write
//-------------------------------------------------

void abc890_device::abcbus_xmemw(offs_t offset, uint8_t data)
{
	for (abcbus_slot_device &slot : abcbus_slot_device_iterator(*this))
	{
		slot.xmemw_w(offset, data);
	}
}