Previous 15994 Revisions Next

r13043 Saturday 15th October, 2011 at 18:24:55 UTC by Curt Coder
[ABC1600] Added proper expansion bus emulation. (nw)
[src/mess]mess.mak
[src/mess/drivers]abc1600.c
[src/mess/includes]abc1600.h
[src/mess/machine]abc1600_bus.c* abc1600_bus.h*

src/mess/machine/abc1600_bus.c
r0r13043
1/**********************************************************************
2
3    Luxor ABC 1600 Expansion Bus emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "abc1600_bus.h"
11
12
13
14//**************************************************************************
15//  GLOBAL VARIABLES
16//**************************************************************************
17
18const device_type ABC1600BUS_SLOT = &device_creator<abc1600bus_slot_device>;
19
20
21
22//**************************************************************************
23//  DEVICE ABC1600BUS CARD INTERFACE
24//**************************************************************************
25
26//-------------------------------------------------
27//  device_abc1600bus_card_interface - constructor
28//-------------------------------------------------
29
30device_abc1600bus_card_interface::device_abc1600bus_card_interface(const machine_config &mconfig, device_t &device)
31   : device_interface(device)
32{
33}
34
35
36//-------------------------------------------------
37//  ~device_abc1600bus_card_interface - destructor
38//-------------------------------------------------
39
40device_abc1600bus_card_interface::~device_abc1600bus_card_interface()
41{
42}
43
44
45
46//**************************************************************************
47//  LIVE DEVICE
48//**************************************************************************
49
50//-------------------------------------------------
51//  abc1600bus_slot_device - constructor
52//-------------------------------------------------
53
54abc1600bus_slot_device::abc1600bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
55        device_t(mconfig, ABC1600BUS_SLOT, "ABC 1600 bus slot", tag, owner, clock),
56      device_slot_interface(mconfig, *this)
57{
58}
59
60
61//-------------------------------------------------
62//  device_config_complete - perform any
63//  operations now that the configuration is
64//  complete
65//-------------------------------------------------
66
67void abc1600bus_slot_device::device_config_complete()
68{
69   // inherit a copy of the static data
70   const abc1600bus_interface *intf = reinterpret_cast<const abc1600bus_interface *>(static_config());
71   if (intf != NULL)
72   {
73      *static_cast<abc1600bus_interface *>(this) = *intf;
74   }
75
76   // or initialize to defaults if none provided
77   else
78   {
79       memset(&m_out_int_cb, 0, sizeof(m_out_int_cb));
80       memset(&m_out_pren_cb, 0, sizeof(m_out_pren_cb));
81       memset(&m_out_trrq_cb, 0, sizeof(m_out_trrq_cb));
82       memset(&m_out_nmi_cb, 0, sizeof(m_out_nmi_cb));
83       memset(&m_out_xint2_cb, 0, sizeof(m_out_xint2_cb));
84       memset(&m_out_xint3_cb, 0, sizeof(m_out_xint3_cb));
85       memset(&m_out_xint4_cb, 0, sizeof(m_out_xint4_cb));
86       memset(&m_out_xint5_cb, 0, sizeof(m_out_xint5_cb));
87    }
88}
89
90
91//-------------------------------------------------
92//  device_start - device-specific startup
93//-------------------------------------------------
94
95void abc1600bus_slot_device::device_start()
96{
97   // resolve callbacks
98   m_out_int_func.resolve(m_out_int_cb, *this);
99   m_out_pren_func.resolve(m_out_pren_cb, *this);
100   m_out_trrq_func.resolve(m_out_trrq_cb, *this);
101   m_out_nmi_func.resolve(m_out_nmi_cb, *this);
102   m_out_xint2_func.resolve(m_out_xint2_cb, *this);
103   m_out_xint3_func.resolve(m_out_xint3_cb, *this);
104   m_out_xint4_func.resolve(m_out_xint4_cb, *this);
105   m_out_xint5_func.resolve(m_out_xint5_cb, *this);
106}
107
108
109//-------------------------------------------------
110//  cs_w -
111//-------------------------------------------------
112
113WRITE8_MEMBER( abc1600bus_slot_device::cs_w )
114{
115   if (m_card != NULL)
116   {
117      m_card->abc1600bus_cs(data);
118   }
119}
120
121
122//-------------------------------------------------
123//  rst_r -
124//-------------------------------------------------
125
126READ8_MEMBER( abc1600bus_slot_device::rst_r )
127{
128   if (m_card != NULL)
129   {
130      m_card->abc1600bus_rst(0);
131      m_card->abc1600bus_rst(1);
132   }
133
134   return 0xff;
135}
136
137
138//-------------------------------------------------
139//  inp_r -
140//-------------------------------------------------
141
142READ8_MEMBER( abc1600bus_slot_device::inp_r )
143{
144   UINT8 data = 0xff;
145
146   if (m_card != NULL)
147   {
148      data &= m_card->abc1600bus_inp();
149   }
150
151   return data;
152}
153
154
155//-------------------------------------------------
156//  utp_w -
157//-------------------------------------------------
158
159WRITE8_MEMBER( abc1600bus_slot_device::out_w )
160{
161   if (m_card != NULL)
162   {
163      m_card->abc1600bus_out(data);
164   }
165}
166
167
168//-------------------------------------------------
169//  stat_r -
170//-------------------------------------------------
171
172READ8_MEMBER( abc1600bus_slot_device::stat_r )
173{
174   UINT8 data = 0xff;
175
176   if (m_card != NULL)
177   {
178      data &= m_card->abc1600bus_stat();
179   }
180
181   return data;
182}
183
184
185//-------------------------------------------------
186//  stat_r -
187//-------------------------------------------------
188
189READ8_MEMBER( abc1600bus_slot_device::ops_r )
190{
191   UINT8 data = 0xff;
192
193   if (m_card != NULL)
194   {
195      data &= m_card->abc1600bus_ops();
196   }
197
198   return data;
199}
200
201
202//-------------------------------------------------
203//  c1_w -
204//-------------------------------------------------
205
206WRITE8_MEMBER( abc1600bus_slot_device::c1_w )
207{
208   if (m_card != NULL)
209   {
210      m_card->abc1600bus_c1(data);
211   }
212}
213
214
215//-------------------------------------------------
216//  c2_w -
217//-------------------------------------------------
218
219WRITE8_MEMBER( abc1600bus_slot_device::c2_w )
220{
221   if (m_card != NULL)
222   {
223      m_card->abc1600bus_c2(data);
224   }
225}
226
227
228//-------------------------------------------------
229//  c3_w -
230//-------------------------------------------------
231
232WRITE8_MEMBER( abc1600bus_slot_device::c3_w )
233{
234   if (m_card != NULL)
235   {
236      m_card->abc1600bus_c3(data);
237   }
238}
239
240
241//-------------------------------------------------
242//  c4_w -
243//-------------------------------------------------
244
245WRITE8_MEMBER( abc1600bus_slot_device::c4_w )
246{
247   if (m_card != NULL)
248   {
249      m_card->abc1600bus_c4(data);
250   }
251}
252
253
254//-------------------------------------------------
255//  tren_w - transfer enable
256//-------------------------------------------------
257
258WRITE_LINE_MEMBER( abc1600bus_slot_device::tren_w )
259{
260   if (m_card != NULL)
261   {
262      m_card->abc1600bus_tren(state);
263   }
264}
265
266
267//-------------------------------------------------
268//  prac_w - peripheral acknowledge
269//-------------------------------------------------
270
271WRITE_LINE_MEMBER( abc1600bus_slot_device::prac_w )
272{
273   if (m_card != NULL)
274   {
275      m_card->abc1600bus_prac(state);
276   }
277}
278
279
280//-------------------------------------------------
281//  int_w - interrupt request
282//-------------------------------------------------
283
284WRITE_LINE_MEMBER( abc1600bus_slot_device::int_w )
285{
286   m_out_int_func(state);
287}
288
289
290//-------------------------------------------------
291//  pren_w - peripheral enable
292//-------------------------------------------------
293
294WRITE_LINE_MEMBER( abc1600bus_slot_device::pren_w )
295{
296   m_out_pren_func(state);
297}
298
299
300//-------------------------------------------------
301//  trrq_w - transfer request
302//-------------------------------------------------
303
304WRITE_LINE_MEMBER( abc1600bus_slot_device::trrq_w )
305{
306   m_out_trrq_func(state);
307}
308
309
310//-------------------------------------------------
311//  nmi_w - non-maskable interrupt
312//-------------------------------------------------
313
314WRITE_LINE_MEMBER( abc1600bus_slot_device::nmi_w )
315{
316   m_out_nmi_func(state);
317}
318
319
320//-------------------------------------------------
321//  xint2_w - expansion interrupt
322//-------------------------------------------------
323
324WRITE_LINE_MEMBER( abc1600bus_slot_device::xint2_w )
325{
326   m_out_xint2_func(state);
327}
328
329
330//-------------------------------------------------
331//  xint3_w - expansion interrupt
332//-------------------------------------------------
333
334WRITE_LINE_MEMBER( abc1600bus_slot_device::xint3_w )
335{
336   m_out_xint3_func(state);
337}
338
339
340//-------------------------------------------------
341//  xint4_w - expansion interrupt
342//-------------------------------------------------
343
344WRITE_LINE_MEMBER( abc1600bus_slot_device::xint4_w )
345{
346   m_out_xint4_func(state);
347}
348
349
350//-------------------------------------------------
351//  xint5_w - expansion interrupt
352//-------------------------------------------------
353
354WRITE_LINE_MEMBER( abc1600bus_slot_device::xint5_w )
355{
356   m_out_xint5_func(state);
357}
src/mess/machine/abc1600_bus.h
r0r13043
1/**********************************************************************
2
3    Luxor ABC 1600 Expansion Bus emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************
9
10                              A     B
11                -12 V   ---   *  1  *   --- -12V
12                0 V     ---   *  2  *   --- 0 V
13                BPCLK*  ---   *  3  *   --- BPCLK
14                0 V     ---   *  4  *   --- 0 V
15                INT*    ---   *  5  *   --- 0 V
16                D7      ---   *  6  *   --- 0 V
17                D6      ---   *  7  *   ---
18                D5      ---   *  8  *   ---
19                D4      ---   *  9  *   ---
20                D3      ---   * 10  *   --- XINT*5^
21                D2      ---   * 11  *   --- XINT*4^
22                D1      ---   * 12  *   --- XINT*3^
23                D0      ---   * 13  *   --- XINT*2^
24                CSB*    ---   * 14  *   --- XCSB*2^
25                BRST*   ---   * 15  *   --- XCSB*3^
26                STAT*   ---   * 16  *   --- XCSB*4^
27                INP*    ---   * 17  *   --- XCSB*5^
28                C4*     ---   * 18  *   ---
29                C3*     ---   * 19  *   ---
30                C2*     ---   * 20  *   ---
31                C1*     ---   * 21  *   --- EXP*^
32                OUT*    ---   * 22  *   --- BUSEN*^
33                CS*     ---   * 23  *   --- DSTB*
34                NMI*^   ---   * 24  *   --- 0 V
35                OPS*    ---   * 25  *   --- A4
36                        ---   * 26  *   --- A3
37                TREN*   ---   * 27  *   --- A2
38                TRRQ*   ---   * 28  *   --- A1
39                PRAC*   ---   * 29  *   --- A0
40                PREN*   ---   * 30  *   --- DIRW/R*
41                +5 V    ---   * 31  *   --- +5 V
42                +12 V   ---   * 32  *   --- +12 V
43
44               ^ only connected on BUS0X
45           
46**********************************************************************/
47
48#pragma once
49
50#ifndef __ABC1600BUS__
51#define __ABC1600BUS__
52
53#include "emu.h"
54
55
56//**************************************************************************
57//  CONSTANTS
58//**************************************************************************
59
60#define ABC1600BUS_TAG         "abc1600bus"
61
62
63
64//**************************************************************************
65//  INTERFACE CONFIGURATION MACROS
66//**************************************************************************
67
68#define ABC1600BUS_INTERFACE(_name) \
69   const abc1600bus_interface (_name) =
70
71
72#define MCFG_ABC1600BUS_SLOT_ADD(_tag, _config, _slot_intf, _def_slot, _def_inp) \
73    MCFG_DEVICE_ADD(_tag, ABC1600BUS_SLOT, 0) \
74   MCFG_DEVICE_CONFIG(_config) \
75   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp)
76
77
78
79//**************************************************************************
80//  TYPE DEFINITIONS
81//**************************************************************************
82
83// ======================> abc1600bus_interface
84
85struct abc1600bus_interface
86{
87    devcb_write_line   m_out_int_cb;
88    devcb_write_line   m_out_pren_cb;
89    devcb_write_line   m_out_trrq_cb;
90
91   // the following are connected only on BUS0X
92    devcb_write_line   m_out_nmi_cb;
93    devcb_write_line   m_out_xint2_cb;
94    devcb_write_line   m_out_xint3_cb;
95    devcb_write_line   m_out_xint4_cb;
96    devcb_write_line   m_out_xint5_cb;
97};
98
99
100// ======================> device_abc1600bus_card_interface
101
102class abc1600bus_device;
103
104// class representing interface-specific live abc1600bus card
105class device_abc1600bus_card_interface : public device_interface
106{
107   friend class abc1600bus_device;
108
109public:
110   // construction/destruction
111   device_abc1600bus_card_interface(const machine_config &mconfig, device_t &device);
112   virtual ~device_abc1600bus_card_interface();
113
114   // required operation overrides
115   virtual void abc1600bus_cs(UINT8 data) = 0;
116   virtual int abc1600bus_csb() = 0;
117
118   // optional operation overrides
119   virtual void abc1600bus_rst(int state) { };
120   virtual UINT8 abc1600bus_inp() { return 0xff; };
121   virtual void abc1600bus_out(UINT8 data) { };
122   virtual UINT8 abc1600bus_stat() { return 0xff; };
123   virtual UINT8 abc1600bus_ops() { return 0xff; };
124   virtual void abc1600bus_c1(UINT8 data) { };
125   virtual void abc1600bus_c2(UINT8 data) { };
126   virtual void abc1600bus_c3(UINT8 data) { };
127   virtual void abc1600bus_c4(UINT8 data) { };
128   virtual void abc1600bus_tren(int state) { };
129   virtual void abc1600bus_prac(int state) { };
130   virtual int abc1600bus_xcsb2() { return 1; };
131   virtual int abc1600bus_xcsb3() { return 1; };
132   virtual int abc1600bus_xcsb4() { return 1; };
133   virtual int abc1600bus_xcsb5() { return 1; };
134
135public:
136   abc1600bus_device  *m_abc1600bus;
137};
138
139
140// ======================> abc1600bus_slot_device
141
142class abc1600bus_slot_device : public device_t,
143                        public device_slot_interface,
144                        public abc1600bus_interface
145{
146public:
147   // construction/destruction
148   abc1600bus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
149
150   // device-level overrides
151   virtual void device_start();
152   virtual void device_config_complete();
153
154   DECLARE_WRITE8_MEMBER( cs_w );
155   DECLARE_READ8_MEMBER( rst_r );
156   DECLARE_READ8_MEMBER( inp_r );
157   DECLARE_WRITE8_MEMBER( out_w );
158   DECLARE_READ8_MEMBER( stat_r );
159   DECLARE_READ8_MEMBER( ops_r );
160   DECLARE_WRITE8_MEMBER( c1_w );
161   DECLARE_WRITE8_MEMBER( c2_w );
162   DECLARE_WRITE8_MEMBER( c3_w );
163   DECLARE_WRITE8_MEMBER( c4_w );
164   DECLARE_WRITE_LINE_MEMBER( tren_w );
165   DECLARE_WRITE_LINE_MEMBER( prac_w );
166
167   DECLARE_WRITE_LINE_MEMBER( int_w );
168   DECLARE_WRITE_LINE_MEMBER( pren_w );
169   DECLARE_WRITE_LINE_MEMBER( trrq_w );
170   DECLARE_WRITE_LINE_MEMBER( nmi_w );
171   DECLARE_WRITE_LINE_MEMBER( xint2_w );
172   DECLARE_WRITE_LINE_MEMBER( xint3_w );
173   DECLARE_WRITE_LINE_MEMBER( xint4_w );
174   DECLARE_WRITE_LINE_MEMBER( xint5_w );
175   
176private:
177   devcb_resolved_write_line   m_out_int_func;
178   devcb_resolved_write_line   m_out_pren_func;
179   devcb_resolved_write_line   m_out_trrq_func;
180   devcb_resolved_write_line   m_out_nmi_func;
181   devcb_resolved_write_line   m_out_xint2_func;
182   devcb_resolved_write_line   m_out_xint3_func;
183   devcb_resolved_write_line   m_out_xint4_func;
184   devcb_resolved_write_line   m_out_xint5_func;
185   
186   device_abc1600bus_card_interface *m_card;
187};
188
189
190// device type definition
191extern const device_type ABC1600BUS_SLOT;
192
193
194
195#endif
src/mess/includes/abc1600.h
r13042r13043
1313#include "machine/ram.h"
1414#include "machine/8530scc.h"
1515#include "machine/abc99.h"
16#include "machine/abcbus.h"
16#include "machine/abc1600_bus.h"
1717#include "machine/e0516.h"
1818#include "machine/nmc9306.h"
1919#include "machine/s1410.h"
src/mess/mess.mak
r13042r13043
11221122   $(MESS_MACHINE)/lux21046.o   \
11231123   $(MESS_MACHINE)/abc830.o   \
11241124   $(MESS_DRIVERS)/abc1600.o   \
1125   $(MESS_MACHINE)/abc1600_bus.o   \
11251126   $(MESS_VIDEO)/abc1600.o      \
11261127   $(MESS_MACHINE)/s1410.o      \
11271128
src/mess/drivers/abc1600.c
r13042r13043
303303            }
304304            else
305305            {
306               logerror("%s Unmapped write to virtual I/O %06x : %02x\n", offset, data);
306               logerror("%s Unmapped write to virtual I/O %06x : %02x\n", machine().describe_context(), offset, data);
307307            }
308308            break;
309309
r13042r13043
14831483
14841484
14851485//-------------------------------------------------
1486//  ABCBUS_INTERFACE( abcbus_intf )
1486//  ABC1600BUS_INTERFACE( abcbus_intf )
14871487//-------------------------------------------------
14881488
1489static SLOT_INTERFACE_START( abc1600_abcbus_cards )
1489static SLOT_INTERFACE_START( abc1600bus_cards )
14901490//   SLOT_INTERFACE("4105", LUXOR_4105) // SASI interface
14911491//   SLOT_INTERFACE("4077", LUXOR_4077) // Winchester controller
14921492SLOT_INTERFACE_END
14931493
1494static ABC1600BUS_INTERFACE( bus0i_intf )
1495{
1496   DEVCB_NULL,
1497   DEVCB_NULL,
1498   DEVCB_NULL
1499};
14941500
1495static ABCBUS_INTERFACE( abcbus_intf )
1501static ABC1600BUS_INTERFACE( bus0x_intf )
14961502{
14971503   DEVCB_NULL,
14981504   DEVCB_NULL,
14991505   DEVCB_NULL,
1506   DEVCB_NULL,
1507   DEVCB_NULL,
1508   DEVCB_NULL,
1509   DEVCB_NULL,
15001510   DEVCB_NULL
15011511};
15021512
1513static ABC1600BUS_INTERFACE( bus1_intf )
1514{
1515   DEVCB_NULL,
1516   DEVCB_NULL,
1517   DEVCB_NULL
1518};
15031519
1520static ABC1600BUS_INTERFACE( bus2_intf )
1521{
1522   DEVCB_NULL,
1523   DEVCB_NULL,
1524   DEVCB_DEVICE_LINE_MEMBER(Z8410AB1_2_TAG, z80dma_device, rdy_w)
1525};
15041526
1527
1528
15051529//**************************************************************************
15061530//  MACHINE INITIALIZATION
15071531//**************************************************************************
r13042r13043
16201644   MCFG_ABC99_ADD(abc99_intf)
16211645   MCFG_S1410_ADD()
16221646
1623   MCFG_ABCBUS_ADD(MC68008P8_TAG, abcbus_intf)
1624   MCFG_ABCBUS_SLOT_ADD( 1, "bus0i", abc1600_abcbus_cards, NULL, NULL)
1625   MCFG_ABCBUS_SLOT_ADD( 2, "bus0x", abc1600_abcbus_cards, NULL, NULL)
1626   MCFG_ABCBUS_SLOT_ADD( 3, "bus1", abc1600_abcbus_cards, NULL, NULL)
1627   MCFG_ABCBUS_SLOT_ADD( 4, "bus2", abc1600_abcbus_cards, NULL, NULL)
1647   MCFG_ABC1600BUS_SLOT_ADD("bus0i", bus0i_intf, abc1600bus_cards, NULL, NULL)
1648   MCFG_ABC1600BUS_SLOT_ADD("bus0x", bus0x_intf, abc1600bus_cards, NULL, NULL)
1649   MCFG_ABC1600BUS_SLOT_ADD("bus1", bus1_intf, abc1600bus_cards, NULL, NULL)
1650   MCFG_ABC1600BUS_SLOT_ADD("bus2", bus2_intf, abc1600bus_cards, NULL, NULL)
16281651
16291652   // internal ram
16301653   MCFG_RAM_ADD(RAM_TAG)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team