summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/dmv/dmvbus.cpp
blob: 379be49cef238600173f13dc631860f251c0199b (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
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
// license:BSD-3-Clause
// copyright-holders:Sandro Ronco
/*********************************************************************

    NCR Decision mate slot bus and module emulation

    From the NCR System Technical manual:

    "The lower part of the controller board contains the I/0 bus together with
    seven user-accessible connectors. These connectors are identified on the board
    as J1 through J7 (reading from left to right), and correspond to the seven slots
    (numbers 1 through 7) at the rear of the cabinet.
    Position J1 is reserved for the connection of any one of the memory expansion modules
    (K200, K202, K208).
    Position J7 is reserved for the connection of either the diagnostic module (K220),
    or the customer-installable 16-bit processor module (K231).
    Positions J2 through J6 are the general purpose slots for the connection of the peripheral
    adapter and other interfaces to the computer. These five positions are identical, and Figure 2.2
    defines the type of connector, while the pin assignments are shown in Figure 2.3."

    Pinout (/ indicates an inverted signal, ie, one that would have a bar over it
              on a schematic diagram)

                                               a        c
                                       |-------------------------|
                                       |+5V        1    +5 V     |
                                       |                         |
                                       |           2    +12 V    |
                                       |                         |
        System Reset Output, act. low  |RESET/     3    RESET IN/|  active low, general system RESET
                                       |                         |
        I/O Write                      |IOW/       4    IOR/     |  I/O read    R/W lines are Processor control lines
                                       |                         |
        Memory Write                   |MEMW/      5    MEMR/    |  Memory read active low, Tri-State possible
                                       |                         |
        BD0-BD7: Switch by IFSEL       |BD1        6    BDO      |  BD0 - BD7: Data-Bus lines (8 bit)
        (I/O-Read). Normal Output.     |                         |  bidirectional, active high
                                       |BD3        7    BD2      |
                                       |                         |
        Direction can be changed       |BD5        8    BD4      |  Bus-Driver to peripheral Bus (LS245)
        by DIR/ signal.                |                         |  automatic detection
                                       |BD7        9    BD6      |
                                       |                         |
        Ready Signal from the          |READY DMA 10    ABTRI /  |  Address Bus Tri-State, active low signal
        mem. contr. (XACK), act. hi.   |                         |
        End of Process-EOP signals that|EOP/      11             |  cf. 8234A-6 spec.
        DMA service has been completed |                         |
                                       |INTACK/   12    IFSEL 4/ |
                                       |                         |
        Change peripheral from board   |AUTO/     13    DIR/     |  Direction of the databus driver. Low signal
        type 1 to 2.NC on type 1       |                         |  change to input.
        Test Hold. External request    |THOLD/    14    HLDA     |  Hold Acknowledge. A response from the Z80
        to set the Z80 in hold state.  |                         |  The Z80 CPU is in hold state, active high.
        Processor-Clock: inverse signal|PCLK/     15    CLK1     |  Clock Output 1 MHz
        of the CPU clock, freq. 4MHz   |                         |
        Logic Ground                   |LGRD      16    TRAMD/   |  Test RAM-Disable. For ext. ROM or RAM expansion.
                                       |                         |  Switching with the System RAM, RAM output disabled. act. low
                                       |BA19      17    BA18     |  BA0-BA19: Buffered 20bit Address Bus
                                       |                         |
                                       |BA17      18    BA16     |
                                       |                         |
                                       |BA15      19    BA14     |  Range to 1MB Normal output, active high
                                       |                         |
                                       |BA13      20    BA12     |
                                       |                         |
                                       |BA11      21    BA10     |  Tri-State possible with ABTRI/ signal
                                       |                         |
                                       |BA9       22    BA8      |
                                       |                         |
                                       |BA7       23    BA6      |
                                       |                         |
                                       |BA5       24    BA4      |
                                       |                         |
                                       |BA3       25    BA2      |
                                       |                         |
                                       |BA1       26    BAO      |
                                       |                         |
        IFSEL 0-4, active low          |IFSEL3/   27    IFSEL2/  |  The select of the I/O pprts in the peripherals is made
        The interface does not need    |                         |  by any IFSEL and BA3 (BA3/). (10 peripherals). Automatic
        own address decoder            |IFSEL1/   28    IFSELO/  |  change of the data bus direction. This change is not possible
                                       |                         |  while a dma function is performed
        DRQ0-DRQ1: DMA Request for     |DRQ1      29    DRQ0     |  Asynchr. channel requests are used by peripherals
        resp. channels, act. high      |                         |  to request DMA service
        DACK0-DACK1:                   |DACK1 /   30    DACK0/   |  DMA-Acknowledge Channels 0 and 1, active low
                                       |                         |  These lines indicate an active DMA channel
                                       |WAIT/     31    INT/     |
                                       |                         |
        Logic Ground                   |LGRD      32    LGRD     |  Logic Ground
                                       |-------------------------|

    Two additional plug/socket connections are possible on the bus. These are made on the solder side of the controller board
    and are designated J2A and J7 A. These connectors are not considered to be user accessible , rather for factory use ,
    or for use by field engineers and system integrators. Normally, these two connectors are used for:
    ??? J2A - The connection of the fixed disk interface board, or a custom design board.
    ??? J7A - The connection of the 16-bit processor board (factory option and kit K230).

    The processor and diagnostics module for Slots J7 and J7A have the following additional signals in addition to the ones present on Slots J2-J6.
    Note that the middle row of the connector (row "b") carries some signals too:

    A2 - OPT 2
    Signals A19-A26 and C19-C26 are called e.g. A7 instead of BA7 in the processor module schematic (fig. 2.14, page 2.21 System Technical Manual Hardware)
    Signals A6-A9 and C6-D9 are called e.g. D4 instead of BD4 in the processor module schematic
    B10 - READYP
    B11 - HOLD
    B12 - SWITCH 16/
    B13 - HLDA 16
    B14 - 16 BITAV
    B15 - STDMARQ
    B16 - LGRD
    B17 - 16 BITSET/
    B20 - MEMRQ/
    B32 - LGRD

    The memory modules on J1 share the same physical connector with the other expansion modules, but carry different signals:

    A1 - +5V            C1 - +5V
    A2                  C2
    A3 - AOUT7          C3
    A4 - AOUT6          C4 - AOUT5
    A5 - AOUT4          C5 - AOUT3
    A6                  C6
    A7                  C7
    A8                  C8
    A9                  C9
    A10                 C10 - AOUT2
    A11                 C11 - AOUT1
    A12 - OD0           C12 - AOUT0
    A13 - OD1           C13 - OD2
    A14 - OD3           C14
    A15                 C15
    A16 - LGRD          C16 - LGRD
    A17                 C17
    A18                 C18
    A19 - ID0           C19
    A20 - ID1           C20
    A21 - ID2           C21
    A22 - ID3           C22
    A23 - ID4           C23 - CAS7/
    A24 - ID5           C24 - CAS6/
    A25 - ID6           C25 - CAS5/
    A26 - ID7           C26 - CAS4/
    A27 - CAS2/         C27 - CAS1/
    A28 - CAS3/         C28
    A29 - OD4           C29 - OD5
    A30 - RAS/          C30 - WE/
    A31 - OD6           C31 - OD7
    A32 - LGRD          C32 - LGRD


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


#include "emu.h"
#include "dmvbus.h"


/***************************************************************************
    PARAMETERS
***************************************************************************/

//**************************************************************************
//  GLOBAL VARIABLES
//**************************************************************************

const device_type DMVCART_SLOT = device_creator<dmvcart_slot_device>;

//**************************************************************************
//    DMV cartridge interface
//**************************************************************************

//-------------------------------------------------
//  device_dmvslot_interface - constructor
//-------------------------------------------------

device_dmvslot_interface::device_dmvslot_interface(const machine_config &mconfig, device_t &device)
	: device_slot_card_interface(mconfig, device)
{
}


//-------------------------------------------------
//  ~device_dmvslot_interface - destructor
//-------------------------------------------------

device_dmvslot_interface::~device_dmvslot_interface()
{
}


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

//-------------------------------------------------
//  dmvcart_slot_device - constructor
//-------------------------------------------------
dmvcart_slot_device::dmvcart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
		device_t(mconfig, DMVCART_SLOT, "Decision Mate V cartridge slot", tag, owner, clock, "dmvcart_slot", __FILE__),
		device_slot_interface(mconfig, *this),
		m_prog_read_cb(*this),
		m_prog_write_cb(*this),
		m_out_int_cb(*this),
		m_out_irq_cb(*this),
		m_out_thold_cb(*this), m_cart(nullptr)
{
}


//-------------------------------------------------
//  dmvcart_slot_device - destructor
//-------------------------------------------------

dmvcart_slot_device::~dmvcart_slot_device()
{
}

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

void dmvcart_slot_device::device_start()
{
	m_cart = dynamic_cast<device_dmvslot_interface *>(get_card_device());

	// resolve callbacks
	m_prog_read_cb.resolve_safe(0);
	m_prog_write_cb.resolve_safe();
	m_out_int_cb.resolve_safe();
	m_out_irq_cb.resolve_safe();
	m_out_thold_cb.resolve_safe();
}

/*-------------------------------------------------
    read
-------------------------------------------------*/

bool dmvcart_slot_device::read(offs_t offset, uint8_t &data)
{
	if (m_cart)
		return m_cart->read(offset, data);
	return false;
}

/*-------------------------------------------------
    write
-------------------------------------------------*/

bool dmvcart_slot_device::write(offs_t offset, uint8_t data)
{
	if (m_cart)
		return m_cart->write(offset, data);
	return false;
}

/*-------------------------------------------------
    read
-------------------------------------------------*/

void dmvcart_slot_device::ram_read(uint8_t cas, offs_t offset, uint8_t &data)
{
	if (m_cart)
		m_cart->ram_read(cas, offset, data);
}

/*-------------------------------------------------
    write
-------------------------------------------------*/

void dmvcart_slot_device::ram_write(uint8_t cas, offs_t offset, uint8_t data)
{
	if (m_cart)
		return m_cart->ram_write(cas, offset, data);
}

/*-------------------------------------------------
    IO read
-------------------------------------------------*/

void dmvcart_slot_device::io_read(address_space &space, int ifsel, offs_t offset, uint8_t &data)
{
	if (m_cart)
		m_cart->io_read(space, ifsel, offset, data);
}


/*-------------------------------------------------
   IO write
-------------------------------------------------*/

void dmvcart_slot_device::io_write(address_space &space, int ifsel, offs_t offset, uint8_t data)
{
	if (m_cart)
		m_cart->io_write(space, ifsel, offset, data);
}

/*-------------------------------------------------
    av16bit
-------------------------------------------------*/

bool dmvcart_slot_device::av16bit()
{
	if (m_cart)
		return m_cart->av16bit();
	return  false;
}

/*-------------------------------------------------
    hold_w
-------------------------------------------------*/

void dmvcart_slot_device::hold_w(int state)
{
	if (m_cart)
		m_cart->hold_w(state);
}

void dmvcart_slot_device::switch16_w(int state)
{
	if (m_cart)
		m_cart->switch16_w(state);
}

void dmvcart_slot_device::timint_w(int state)
{
	if (m_cart)
		m_cart->timint_w(state);
}

void dmvcart_slot_device::keyint_w(int state)
{
	if (m_cart)
		m_cart->keyint_w(state);
}

void dmvcart_slot_device::busint_w(int state)
{
	if (m_cart)
		m_cart->busint_w(state);
}

void dmvcart_slot_device::flexint_w(int state)
{
	if (m_cart)
		m_cart->flexint_w(state);
}

void dmvcart_slot_device::irq2_w(int state)
{
	if (m_cart)
		m_cart->irq2_w(state);
}

void dmvcart_slot_device::irq2a_w(int state)
{
	if (m_cart)
		m_cart->irq2a_w(state);
}

void dmvcart_slot_device::irq3_w(int state)
{
	if (m_cart)
		m_cart->irq3_w(state);
}

void dmvcart_slot_device::irq4_w(int state)
{
	if (m_cart)
		m_cart->irq4_w(state);
}

void dmvcart_slot_device::irq5_w(int state)
{
	if (m_cart)
		m_cart->irq5_w(state);
}

void dmvcart_slot_device::irq6_w(int state)
{
	if (m_cart)
		m_cart->irq6_w(state);
}