Previous 199869 Revisions Next

r18180 Thursday 27th September, 2012 at 16:53:42 UTC by Curt Coder
Implemented DS75160A/DS75161A IEEE-488 GPIB Transceivers. [Curt Coder]

(MESS) cbm2: Fixed floppy loading for PAL drivers. (nw)
[hash]cbm2_cart.xml
[src/emu]emu.mak
[src/emu/machine]6526cia.c 6532riot.c 6532riot.h ds75160a.c* ds75160a.h* ds75161a.c* ds75161a.h*
[src/mess/drivers]cbm2.c
[src/mess/includes]cbm2.h
[src/mess/machine]cbm2exp.c

trunk/src/emu/emu.mak
r18179r18180
174174   $(EMUMACHINE)/ds1302.o      \
175175   $(EMUMACHINE)/ds2401.o      \
176176   $(EMUMACHINE)/ds2404.o      \
177   $(EMUMACHINE)/ds75160a.o   \
178   $(EMUMACHINE)/ds75161a.o   \
177179   $(EMUMACHINE)/e0516.o      \
178180   $(EMUMACHINE)/eeprom.o      \
179181   $(EMUMACHINE)/er2055.o      \
trunk/src/emu/machine/ds75161a.c
r0r18180
1/**********************************************************************
2
3    National Semiconductor DS75161A IEEE-488 GPIB Transceiver emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "ds75161a.h"
11
12
13
14//**************************************************************************
15//  DEVICE TYPE DEFINITIONS
16//**************************************************************************
17
18const device_type DS75161A = &device_creator<ds75161a_device>;
19
20
21
22//**************************************************************************
23//  LIVE DEVICE
24//**************************************************************************
25
26//-------------------------------------------------
27//  ds75161a_device - constructor
28//-------------------------------------------------
29
30ds75161a_device::ds75161a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
31    : device_t(mconfig, DS75161A, "DS75161A", tag, owner, clock),
32     m_ren(1),
33     m_ifc(1),
34     m_ndac(1),
35     m_nrfd(1),
36     m_dav(1),
37     m_eoi(1),
38     m_atn(1),
39     m_srq(1),
40     m_te(0),
41     m_dc(0)
42{
43}
44
45
46//-------------------------------------------------
47//  device_config_complete - perform any
48//  operations now that the configuration is
49//  complete
50//-------------------------------------------------
51
52void ds75161a_device::device_config_complete()
53{
54   // inherit a copy of the static data
55   const ds75161a_interface *intf = reinterpret_cast<const ds75161a_interface *>(static_config());
56   if (intf != NULL)
57      *static_cast<ds75161a_interface *>(this) = *intf;
58
59   // or initialize to defaults if none provided
60   else
61   {
62      memset(&m_in_ren_cb, 0, sizeof(m_in_ren_cb));
63      memset(&m_in_ifc_cb, 0, sizeof(m_in_ifc_cb));
64      memset(&m_in_ndac_cb, 0, sizeof(m_in_ndac_cb));
65      memset(&m_in_nrfd_cb, 0, sizeof(m_in_nrfd_cb));
66      memset(&m_in_dav_cb, 0, sizeof(m_in_dav_cb));
67      memset(&m_in_eoi_cb, 0, sizeof(m_in_eoi_cb));
68      memset(&m_in_atn_cb, 0, sizeof(m_in_atn_cb));
69      memset(&m_in_srq_cb, 0, sizeof(m_in_srq_cb));
70
71      memset(&m_out_ren_cb, 0, sizeof(m_out_ren_cb));
72      memset(&m_out_ifc_cb, 0, sizeof(m_out_ifc_cb));
73      memset(&m_out_ndac_cb, 0, sizeof(m_out_ndac_cb));
74      memset(&m_out_nrfd_cb, 0, sizeof(m_out_nrfd_cb));
75      memset(&m_out_dav_cb, 0, sizeof(m_out_dav_cb));
76      memset(&m_out_eoi_cb, 0, sizeof(m_out_eoi_cb));
77      memset(&m_out_atn_cb, 0, sizeof(m_out_atn_cb));
78      memset(&m_out_srq_cb, 0, sizeof(m_out_srq_cb));
79   }
80}
81
82
83//-------------------------------------------------
84//  device_start - device-specific startup
85//-------------------------------------------------
86
87void ds75161a_device::device_start()
88{
89   // resolve callbacks
90   m_in_ren_func.resolve(m_in_ren_cb, *this);
91   m_in_ifc_func.resolve(m_in_ifc_cb, *this);
92   m_in_ndac_func.resolve(m_in_ndac_cb, *this);
93   m_in_nrfd_func.resolve(m_in_nrfd_cb, *this);
94   m_in_dav_func.resolve(m_in_dav_cb, *this);
95   m_in_eoi_func.resolve(m_in_eoi_cb, *this);
96   m_in_atn_func.resolve(m_in_atn_cb, *this);
97   m_in_srq_func.resolve(m_in_srq_cb, *this);
98   
99   m_out_ren_func.resolve(m_out_ren_cb, *this);
100   m_out_ifc_func.resolve(m_out_ifc_cb, *this);
101   m_out_ndac_func.resolve(m_out_ndac_cb, *this);
102   m_out_nrfd_func.resolve(m_out_nrfd_cb, *this);
103   m_out_dav_func.resolve(m_out_dav_cb, *this);
104   m_out_eoi_func.resolve(m_out_eoi_cb, *this);
105   m_out_atn_func.resolve(m_out_atn_cb, *this);
106   m_out_srq_func.resolve(m_out_srq_cb, *this);
107
108   // register for state saving
109   save_item(NAME(m_ren));
110   save_item(NAME(m_ifc));
111   save_item(NAME(m_ndac));
112   save_item(NAME(m_nrfd));
113   save_item(NAME(m_dav));
114   save_item(NAME(m_eoi));
115   save_item(NAME(m_atn));
116   save_item(NAME(m_srq));
117   save_item(NAME(m_te));
118   save_item(NAME(m_dc));
119}
120
121
122//-------------------------------------------------
123//  update_signals -
124//-------------------------------------------------
125
126void ds75161a_device::update_signals()
127{
128   m_out_ren_func(m_dc ? 1 : m_ren);
129   m_out_ifc_func(m_dc ? 1 : m_ifc);
130   m_out_ndac_func(m_te ? 1 : m_ndac);
131   m_out_nrfd_func(m_te ? 1 : m_nrfd);
132   m_out_dav_func(m_te ? m_dav : 1);
133   m_out_atn_func(m_dc ? 1 : m_atn);
134   m_out_srq_func(m_dc ? m_srq : 1 );
135
136   int atn = m_in_atn_func();
137
138   if (m_te && atn) m_out_eoi_func(m_eoi);
139   else if (!m_dc && !atn) m_out_eoi_func(m_eoi);
140   else m_out_eoi_func(1);
141}
142
143
144//-------------------------------------------------
145//  te_w - transmit enable
146//-------------------------------------------------
147
148WRITE_LINE_MEMBER( ds75161a_device::te_w )
149{
150   if (m_te != state)
151   {
152      m_te = state;
153
154      update_signals();
155   }
156}
157
158
159//-------------------------------------------------
160//  dc_w - direction control
161//-------------------------------------------------
162
163WRITE_LINE_MEMBER( ds75161a_device::dc_w )
164{
165   if (m_dc != state)
166   {
167      m_dc = state;
168
169      update_signals();
170   }
171}
172
173
174//-------------------------------------------------
175//  ren_r - remote enable read
176//-------------------------------------------------
177
178READ_LINE_MEMBER( ds75161a_device::ren_r )
179{
180   return m_dc ? m_in_ren_func() : 0;
181}
182
183
184//-------------------------------------------------
185//  ifc_r - interface clear read
186//-------------------------------------------------
187
188READ_LINE_MEMBER( ds75161a_device::ifc_r )
189{
190   return m_dc ? m_in_ifc_func() : 0;
191}
192
193
194//-------------------------------------------------
195//  ndac_r - not data acknowledge read
196//-------------------------------------------------
197
198READ_LINE_MEMBER( ds75161a_device::ndac_r )
199{
200   return m_te ? m_in_ndac_func() : 0;
201}
202
203
204//-------------------------------------------------
205//  nrfd_r - not ready for data read
206//-------------------------------------------------
207
208READ_LINE_MEMBER( ds75161a_device::nrfd_r )
209{
210   return m_te ? m_in_nrfd_func() : 0;
211}
212
213
214//-------------------------------------------------
215//  dav_r - data valid read
216//-------------------------------------------------
217
218READ_LINE_MEMBER( ds75161a_device::dav_r )
219{
220   return m_te ? 0 : m_in_dav_func();
221}
222
223
224//-------------------------------------------------
225//  eoi_r - end or identify read
226//-------------------------------------------------
227
228READ_LINE_MEMBER( ds75161a_device::eoi_r )
229{
230   int atn = m_in_atn_func();
231   int eoi = m_in_eoi_func();
232
233   if (!m_te && atn) return eoi;
234   else if (m_dc && !atn) return eoi;
235   else return 0;
236}
237
238
239//-------------------------------------------------
240//  atn_r - attention read
241//-------------------------------------------------
242
243READ_LINE_MEMBER( ds75161a_device::atn_r )
244{
245   return m_dc ? m_in_atn_func() : 0;
246}
247
248
249//-------------------------------------------------
250//  srq_r - service request read
251//-------------------------------------------------
252
253READ_LINE_MEMBER( ds75161a_device::srq_r )
254{
255   return m_dc ? 0 : m_in_srq_func();
256}
257
258
259//-------------------------------------------------
260//  ren_w - remote enable write
261//-------------------------------------------------
262
263WRITE_LINE_MEMBER( ds75161a_device::ren_w )
264{
265   if (m_ren != state)
266   {
267      m_ren = state;
268
269      update_signals();
270   }
271}
272
273
274//-------------------------------------------------
275//  ifc_w - interface clear write
276//-------------------------------------------------
277
278WRITE_LINE_MEMBER( ds75161a_device::ifc_w )
279{
280   if (m_ifc != state)
281   {
282      m_ifc = state;
283
284      update_signals();
285   }
286}
287
288
289//-------------------------------------------------
290//  ndac_w - not data acknowledge write
291//-------------------------------------------------
292
293WRITE_LINE_MEMBER( ds75161a_device::ndac_w )
294{
295   if (m_ndac != state)
296   {
297      m_ndac = state;
298
299      update_signals();
300   }
301}
302
303
304//-------------------------------------------------
305//  nrfd_w - not ready for data write
306//-------------------------------------------------
307
308WRITE_LINE_MEMBER( ds75161a_device::nrfd_w )
309{
310   if (m_nrfd != state)
311   {
312      m_nrfd = state;
313
314      update_signals();
315   }
316}
317
318
319//-------------------------------------------------
320//  dav_w - data valid write
321//-------------------------------------------------
322
323WRITE_LINE_MEMBER( ds75161a_device::dav_w )
324{
325   if (m_dav != state)
326   {
327      m_dav = state;
328
329      update_signals();
330   }
331}
332
333
334//-------------------------------------------------
335//  eoi_w - end or identify write
336//-------------------------------------------------
337
338WRITE_LINE_MEMBER( ds75161a_device::eoi_w )
339{
340   if (m_eoi != state)
341   {
342      m_eoi = state;
343
344      update_signals();
345   }
346}
347
348
349//-------------------------------------------------
350//  atn_w - attention write
351//-------------------------------------------------
352
353WRITE_LINE_MEMBER( ds75161a_device::atn_w )
354{
355   if (m_atn != state)
356   {
357      m_atn = state;
358
359      update_signals();
360   }
361}
362
363
364//-------------------------------------------------
365//  srq_w - service request write
366//-------------------------------------------------
367
368WRITE_LINE_MEMBER( ds75161a_device::srq_w )
369{
370   if (m_srq != state)
371   {
372      m_srq = state;
373
374      update_signals();
375   }
376}
trunk/src/emu/machine/ds75161a.h
r0r18180
1/**********************************************************************
2
3    National Semiconductor DS75161A IEEE-488 GPIB Transceiver emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************
9                            _____   _____
10                    TE   1 |*    \_/     | 20  Vcc
11                   REN   2 |             | 19  REN
12                   IFC   3 |             | 18  IFC
13                  NDAC   4 |             | 17  NDAC
14                  NRFD   5 |   DS75161A  | 16  NRFD
15                   DAV   6 |             | 15  DAV
16                   EOI   7 |             | 14  EOI
17                   ATN   8 |             | 13  ATN
18                   SRQ   8 |             | 12  SRQ
19                   GND  10 |_____________| 11  DC
20
21**********************************************************************/
22
23#pragma once
24
25#ifndef __DS75161A__
26#define __DS75161A__
27
28#include "emu.h"
29
30
31
32///*************************************************************************
33//  INTERFACE CONFIGURATION MACROS
34///*************************************************************************
35
36#define MCFG_DS75161A_ADD(_tag, _config) \
37   MCFG_DEVICE_ADD(_tag, DS75161A, 0)   \
38   MCFG_DEVICE_CONFIG(_config)
39
40
41#define DS75161A_INTERFACE(name) \
42   const ds75161a_interface (name) =
43
44
45
46///*************************************************************************
47//  TYPE DEFINITIONS
48///*************************************************************************
49
50// ======================> ds75161a_interface
51
52struct ds75161a_interface
53{
54   devcb_read_line      m_in_ren_cb;
55   devcb_read_line      m_in_ifc_cb;
56   devcb_read_line      m_in_ndac_cb;
57   devcb_read_line      m_in_nrfd_cb;
58   devcb_read_line      m_in_dav_cb;
59   devcb_read_line      m_in_eoi_cb;
60   devcb_read_line      m_in_atn_cb;
61   devcb_read_line      m_in_srq_cb;
62
63   devcb_write_line   m_out_ren_cb;
64   devcb_write_line   m_out_ifc_cb;
65   devcb_write_line   m_out_ndac_cb;
66   devcb_write_line   m_out_nrfd_cb;
67   devcb_write_line   m_out_dav_cb;
68   devcb_write_line   m_out_eoi_cb;
69   devcb_write_line   m_out_atn_cb;
70   devcb_write_line   m_out_srq_cb;
71};
72
73
74// ======================> ds75161a_device
75
76class ds75161a_device :   public device_t,
77                        public ds75161a_interface
78{
79public:
80    // construction/destruction
81    ds75161a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
82
83    DECLARE_WRITE_LINE_MEMBER( te_w );
84    DECLARE_WRITE_LINE_MEMBER( dc_w );
85
86    DECLARE_READ_LINE_MEMBER( ren_r );
87    DECLARE_READ_LINE_MEMBER( ifc_r );
88    DECLARE_READ_LINE_MEMBER( ndac_r );
89    DECLARE_READ_LINE_MEMBER( nrfd_r );
90    DECLARE_READ_LINE_MEMBER( dav_r );
91    DECLARE_READ_LINE_MEMBER( eoi_r );
92    DECLARE_READ_LINE_MEMBER( atn_r );
93    DECLARE_READ_LINE_MEMBER( srq_r );
94   
95    DECLARE_WRITE_LINE_MEMBER( ren_w );
96    DECLARE_WRITE_LINE_MEMBER( ifc_w );
97    DECLARE_WRITE_LINE_MEMBER( ndac_w );
98    DECLARE_WRITE_LINE_MEMBER( nrfd_w );
99    DECLARE_WRITE_LINE_MEMBER( dav_w );
100    DECLARE_WRITE_LINE_MEMBER( eoi_w );
101    DECLARE_WRITE_LINE_MEMBER( atn_w );
102    DECLARE_WRITE_LINE_MEMBER( srq_w );
103
104protected:
105    // device-level overrides
106   virtual void device_config_complete();
107    virtual void device_start();
108
109private:
110   void update_signals();
111
112   devcb_resolved_read_line   m_in_ren_func;
113   devcb_resolved_read_line   m_in_ifc_func;
114   devcb_resolved_read_line   m_in_ndac_func;
115   devcb_resolved_read_line   m_in_nrfd_func;
116   devcb_resolved_read_line   m_in_dav_func;
117   devcb_resolved_read_line   m_in_eoi_func;
118   devcb_resolved_read_line   m_in_atn_func;
119   devcb_resolved_read_line   m_in_srq_func;
120
121   devcb_resolved_write_line   m_out_ren_func;
122   devcb_resolved_write_line   m_out_ifc_func;
123   devcb_resolved_write_line   m_out_ndac_func;
124   devcb_resolved_write_line   m_out_nrfd_func;
125   devcb_resolved_write_line   m_out_dav_func;
126   devcb_resolved_write_line   m_out_eoi_func;
127   devcb_resolved_write_line   m_out_atn_func;
128   devcb_resolved_write_line   m_out_srq_func;
129
130   int m_ren;
131   int m_ifc;
132   int m_ndac;
133   int m_nrfd;
134   int m_dav;
135   int m_eoi;
136   int m_atn;
137   int m_srq;
138
139   int m_te;
140   int m_dc;
141};
142
143
144// device type definition
145extern const device_type DS75161A;
146
147
148
149#endif
trunk/src/emu/machine/6526cia.c
r18179r18180
128128   m_cnt = 1;
129129   m_sp = 0;
130130
131   /* initialize data direction registers */
132   m_port[0].m_ddr = !strcmp(tag(), "cia_0") ? 0x03 : 0xff;
133   m_port[1].m_ddr = !strcmp(tag(), "cia_0") ? 0x00 : 0xff;
134
135131   /* TOD running by default */
136132   m_tod_running = TRUE;
137133
trunk/src/emu/machine/6532riot.c
r18179r18180
475475
476476void riot6532_device::device_start()
477477{
478   /* validate arguments */
479   assert(this != NULL);
480
481   /* set static values */
482   device_type_iterator<&device_creator<riot6532_device>, riot6532_device> iter(machine().root_device());
483   m_index = iter.indexof(*this);
484
485478   /* configure the ports */
486479   m_port[0].m_in_func.resolve(m_in_a_cb, *this);
487480   m_port[0].m_out_func.resolve(m_out_a_cb, *this);
trunk/src/emu/machine/6532riot.h
r18179r18180
9393    void update_pa7_state();
9494    UINT8 get_timer();
9595
96    int             m_index;
97
9896    riot6532_port   m_port[2];
9997
10098    devcb_resolved_write_line   m_irq_func;
trunk/src/emu/machine/ds75160a.c
r0r18180
1/**********************************************************************
2
3    National Semiconductor DS75160A IEEE-488 GPIB Transceiver emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "ds75160a.h"
11
12
13
14//**************************************************************************
15//  DEVICE TYPE DEFINITIONS
16//**************************************************************************
17
18const device_type DS75160A = &device_creator<ds75160a_device>;
19
20
21
22//**************************************************************************
23//  LIVE DEVICE
24//**************************************************************************
25
26//-------------------------------------------------
27//  ds75160a_device - constructor
28//-------------------------------------------------
29
30ds75160a_device::ds75160a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
31    : device_t(mconfig, DS75160A, "DS75160A", tag, owner, clock),
32      m_data(0xff),
33      m_te(0),
34      m_pe(0)
35{
36}
37
38
39//-------------------------------------------------
40//  device_config_complete - perform any
41//  operations now that the configuration is
42//  complete
43//-------------------------------------------------
44
45void ds75160a_device::device_config_complete()
46{
47   // inherit a copy of the static data
48   const ds75160a_interface *intf = reinterpret_cast<const ds75160a_interface *>(static_config());
49   if (intf != NULL)
50      *static_cast<ds75160a_interface *>(this) = *intf;
51
52   // or initialize to defaults if none provided
53   else
54   {
55      memset(&m_in_bus_cb, 0, sizeof(m_in_bus_cb));
56      memset(&m_out_bus_cb, 0, sizeof(m_out_bus_cb));
57   }
58}
59
60
61//-------------------------------------------------
62//  device_start - device-specific startup
63//-------------------------------------------------
64
65void ds75160a_device::device_start()
66{
67   // resolve callbacks
68   m_in_bus_func.resolve(m_in_bus_cb, *this);
69   m_out_bus_func.resolve(m_out_bus_cb, *this);
70
71   // register for state saving
72   save_item(NAME(m_data));
73   save_item(NAME(m_te));
74   save_item(NAME(m_pe));
75}
76
77
78//-------------------------------------------------
79//  read - read data bus
80//-------------------------------------------------
81
82READ8_MEMBER( ds75160a_device::read )
83{
84   UINT8 data = 0;
85
86   if (!m_te)
87   {
88      data = m_in_bus_func(0);
89   }
90
91   return data;
92}
93
94
95//-------------------------------------------------
96//  write - write data bus
97//-------------------------------------------------
98
99WRITE8_MEMBER( ds75160a_device::write )
100{
101   m_data = data;
102
103   if (m_te)
104   {
105      m_out_bus_func(0, m_data);
106   }
107}
108
109
110//-------------------------------------------------
111//  te_w - transmit enable
112//-------------------------------------------------
113
114WRITE_LINE_MEMBER( ds75160a_device::te_w )
115{
116   if (m_te != state)
117   {
118      m_out_bus_func(0, m_te ? m_data : 0xff);
119   }
120
121   m_te = state;
122}
123
124
125//-------------------------------------------------
126//  pe_w - parallel enable
127//-------------------------------------------------
128
129WRITE_LINE_MEMBER( ds75160a_device::pe_w )
130{
131   m_pe = state;
132}
trunk/src/emu/machine/ds75160a.h
r0r18180
1/**********************************************************************
2
3    National Semiconductor DS75160A IEEE-488 GPIB Transceiver emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************
9                            _____   _____
10                    TE   1 |*    \_/     | 20  Vcc
11                    D1   2 |             | 19  D1
12                    D2   3 |             | 18  D2
13                    D3   4 |             | 17  D3
14                    D4   5 |   DS75160A  | 16  D4
15                    D5   6 |             | 15  D5
16                    D6   7 |             | 14  D6
17                    D7   8 |             | 13  D7
18                    D8   8 |             | 12  D8
19                   GND  10 |_____________| 11  PE
20
21**********************************************************************/
22
23#pragma once
24
25#ifndef __DS75160A__
26#define __DS75160A__
27
28#include "emu.h"
29
30
31
32///*************************************************************************
33//  INTERFACE CONFIGURATION MACROS
34///*************************************************************************
35
36#define MCFG_DS75160A_ADD(_tag, _config) \
37   MCFG_DEVICE_ADD(_tag, DS75160A, 0)   \
38   MCFG_DEVICE_CONFIG(_config)
39
40
41#define DS75160A_INTERFACE(name) \
42   const ds75160a_interface (name) =
43
44
45
46///*************************************************************************
47//  TYPE DEFINITIONS
48///*************************************************************************
49
50// ======================> ds75160a_interface
51
52struct ds75160a_interface
53{
54   devcb_read8      m_in_bus_cb;
55   devcb_write8   m_out_bus_cb;
56};
57
58
59// ======================> ds75160a_device
60
61class ds75160a_device :   public device_t,
62                        public ds75160a_interface
63{
64public:
65    // construction/destruction
66    ds75160a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
67
68    DECLARE_READ8_MEMBER( read );
69    DECLARE_WRITE8_MEMBER( write );
70
71    DECLARE_WRITE_LINE_MEMBER( te_w );
72    DECLARE_WRITE_LINE_MEMBER( pe_w );
73
74protected:
75    // device-level overrides
76   virtual void device_config_complete();
77    virtual void device_start();
78
79private:
80   devcb_resolved_read8   m_in_bus_func;
81   devcb_resolved_write8   m_out_bus_func;
82
83   UINT8 m_data;
84   
85   int m_te;
86   int m_pe;
87};
88
89
90// device type definition
91extern const device_type DS75160A;
92
93
94
95#endif
trunk/src/mess/machine/cbm2exp.c
r18179r18180
108108      m_bank3_mask = size - 1;
109109   }
110110
111   return m_bank1;
111   return m_bank3;
112112}
113113
114114
trunk/src/mess/includes/cbm2.h
r18179r18180
1212#include "machine/6551acia.h"
1313#include "machine/cbm2exp.h"
1414#include "machine/cbmipt.h"
15#include "machine/ds75160a.h"
16#include "machine/ds75161a.h"
1517#include "machine/ieee488.h"
1618#include "machine/petcass.h"
1719#include "machine/pla.h"
r18179r18180
2729#define PLA2_TAG      "u88"
2830#define MOS6567_TAG      "u23"
2931#define MOS6569_TAG      "u23"
30#define MC68B45_TAG      "u7"
32#define MC68B45_TAG      "u10"
3133#define MOS6851_TAG      "u4"
3234#define MOS6525_1_TAG   "u20"
3335#define MOS6525_2_TAG   "u102"
3436#define MOS6551A_TAG   "u19"
3537#define MOS6526_TAG      "u2"
38#define DS75160A_TAG   "u3"
39#define DS75161A_TAG   "u7"
3640#define SCREEN_TAG      "screen"
3741#define CONTROL1_TAG   "joy1"
3842#define CONTROL2_TAG   "joy2"
r18179r18180
5054        m_tpi2(*this, MOS6525_2_TAG),
5155        m_acia(*this, MOS6551A_TAG),
5256        m_cia(*this, MOS6526_TAG),
57        m_ieee1(*this, DS75160A_TAG),
58        m_ieee2(*this, DS75161A_TAG),
5359        m_joy1(*this, CONTROL1_TAG),
5460        m_joy2(*this, CONTROL2_TAG),
5561        m_exp(*this, CBM2_EXPANSION_SLOT_TAG),
r18179r18180
7884   required_device<tpi6525_device> m_tpi2;
7985   required_device<acia6551_device> m_acia;
8086   required_device<mos6526_device> m_cia;
87   required_device<ds75160a_device> m_ieee1;
88   required_device<ds75161a_device> m_ieee2;
8189   required_device<vcs_control_port_device> m_joy1;
8290   required_device<vcs_control_port_device> m_joy2;
8391   required_device<cbm2_expansion_slot_device> m_exp;
r18179r18180
152160   UINT8 m_tpi2_pb;
153161   UINT8 m_cia_pa;
154162
155   // IEEE-488 state
156   int m_ieee_dc;
157   int m_ieee_te;
158
159163   // timers
160164   emu_timer *m_todclk_timer;
161165};
trunk/src/mess/drivers/cbm2.c
r18179r18180
22
33    TODO:
44
5   - CIA timers fail in burn-in test
6   - NTSC variants unable to load from disk
57   - shift lock
68   - Hungarian keyboard
79   - cbm620hu charom banking?
r18179r18180
10041006         data <<= 1;
10051007      }
10061008
1007      bitmap.pix32(y, x++) = RGB_MONOCHROME_GREEN[BIT(code, 7)];
1009      bitmap.pix32(y, x++) = RGB_MONOCHROME_GREEN[BIT(code, 7) ^ BIT(ma, 13)];
10081010   }
10091011}
10101012
r18179r18180
11211123   UINT8 data = 0;
11221124
11231125   // IEEE-488
1124   if (m_ieee_dc) data |= m_ieee->ren_r() << 2;
1125   if (m_ieee_dc) data |= m_ieee->atn_r() << 3;
1126   if (!m_ieee_te) data |= m_ieee->dav_r() << 4;
1127   if (m_ieee->atn_r() && !m_ieee_te) data |= m_ieee->eoi_r() << 5;
1128   if (!m_ieee->atn_r() && !m_ieee_dc) data |= m_ieee->eoi_r() << 5;
1129   if (m_ieee_te) data |= m_ieee->ndac_r() << 6;
1130   if (m_ieee_te) data |= m_ieee->nrfd_r() << 7;
1126   data |= m_ieee2->ren_r() << 2;
1127   data |= m_ieee2->atn_r() << 3;
1128   data |= m_ieee2->dav_r() << 4;
1129   data |= m_ieee2->eoi_r() << 5;
1130   data |= m_ieee2->ndac_r() << 6;
1131   data |= m_ieee2->nrfd_r() << 7;
11311132
11321133   return data;
11331134}
r18179r18180
11501151   */
11511152
11521153   // IEEE-488
1153   m_ieee_dc = BIT(data, 0);
1154   m_ieee_te = BIT(data, 1);
1154   m_ieee2->dc_w(BIT(data, 0));
11551155
1156   if (!m_ieee_dc) m_ieee->ren_w(BIT(data, 2));
1157   if (!m_ieee_dc) m_ieee->atn_w(BIT(data, 3));
1158   if (m_ieee_te) m_ieee->dav_w(BIT(data, 4));
1159   if (m_ieee->atn_r() && m_ieee_te) m_ieee->eoi_w(BIT(data, 5));
1160   if (!m_ieee->atn_r() && m_ieee_dc) m_ieee->eoi_w(BIT(data, 5));
1161   if (!m_ieee_te) m_ieee->ndac_w(BIT(data, 6));
1162   if (!m_ieee_te) m_ieee->nrfd_w(BIT(data, 7));
1156   m_ieee1->te_w(BIT(data, 1));
1157   m_ieee2->te_w(BIT(data, 1));
1158
1159   m_ieee2->ren_w(BIT(data, 2));
1160   m_ieee2->atn_w(BIT(data, 3));
1161   m_ieee2->dav_w(BIT(data, 4));
1162   m_ieee2->eoi_w(BIT(data, 5));
1163   m_ieee2->ndac_w(BIT(data, 6));
1164   m_ieee2->nrfd_w(BIT(data, 7));
11631165}
11641166
11651167READ8_MEMBER( cbm2_state::tpi1_pb_r )
r18179r18180
11791181   
11801182   */
11811183
1182   UINT8 data = 0xff;
1184   UINT8 data = 0;
11831185
11841186   // IEEE-488
1185   if (m_ieee_dc) data &= m_ieee->ifc_r();
1186   if (!m_ieee_dc) data &= m_ieee->srq_r() << 1;
1187   data |= m_ieee2->ifc_r();
1188   data |= m_ieee2->srq_r() << 1;
11871189   
11881190   // user port
1189   //data &= m_user->pb2_r() << 2;
1190   //data &= m_user->pb3_r() << 3;
1191   //data |= m_user->pb2_r() << 2;
1192   //data |= m_user->pb3_r() << 3;
11911193
11921194   // cassette
1193   data &= m_cassette->sense_r() << 7;
1195   data |= m_cassette->sense_r() << 7;
11941196
11951197   return data;
11961198}
r18179r18180
12131215   */
12141216
12151217   // IEEE-488
1216   if (!m_ieee_dc) m_ieee->ifc_w(BIT(data, 0));
1217   if (m_ieee_dc) m_ieee->srq_w(BIT(data, 1));
1218      m_ieee2->ifc_w(BIT(data, 0));
1219      m_ieee2->srq_w(BIT(data, 1));
12181220
12191221   // user port
12201222   //m_user->pb2_w(BIT(data, 2));
r18179r18180
14491451   
14501452   */
14511453
1452   UINT8 data = 0xff;
1454   UINT8 data = 0;
14531455
1454   if (!m_ieee_te) data &= m_ieee->dio_r();
1456   // IEEE-488
1457   data |= m_ieee1->read(space, 0);
14551458
1456   //data &= m_user->data1_r();
1459   // user port
1460   //data |= m_user->data1_r();
14571461
14581462   // joystick
1459   //data &= BIT(m_joy1->joy_r(), 5) << 6;
1460   //data &= BIT(m_joy2->joy_r(), 5) << 7;
1463   //data |= BIT(m_joy1->joy_r(), 5) << 6;
1464   //data |= BIT(m_joy2->joy_r(), 5) << 7;
14611465
14621466   return data;
14631467}
r18179r18180
14791483   
14801484   */
14811485
1482   if (m_ieee_te) m_ieee->dio_w(data);
1486   // IEEE-488
1487   m_ieee1->write(space, 0, data);
14831488
1489   // user port
14841490   //m_user->data1_w(data);
14851491
1492   // joystick
14861493   m_cia_pa = data;
14871494}
14881495
r18179r18180
15661573
15671574
15681575//-------------------------------------------------
1576//  DS75160A_INTERFACE( ds75160a_intf )
1577//-------------------------------------------------
1578
1579static DS75160A_INTERFACE( ds75160a_intf )
1580{
1581   DEVCB_DEVICE_MEMBER(IEEE488_TAG, ieee488_device, dio_r),
1582   DEVCB_DEVICE_MEMBER(IEEE488_TAG, ieee488_device, dio_w)
1583};
1584
1585
1586//-------------------------------------------------
1587//  DS75161A_INTERFACE( ds75161a_intf )
1588//-------------------------------------------------
1589
1590static DS75161A_INTERFACE( ds75161a_intf )
1591{
1592   DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, ren_r),
1593   DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, ifc_r),
1594   DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, ndac_r),
1595   DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, nrfd_r),
1596   DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, dav_r),
1597   DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, eoi_r),
1598   DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, atn_r),
1599   DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, srq_r),
1600   DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, ren_w),
1601   DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, ifc_w),
1602   DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, ndac_w),
1603   DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, nrfd_w),
1604   DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, dav_w),
1605   DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, eoi_w),
1606   DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, atn_w),
1607   DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, srq_w)
1608};
1609
1610
1611//-------------------------------------------------
15691612//  IEEE488_INTERFACE( ieee488_intf )
15701613//-------------------------------------------------
15711614
r18179r18180
16311674   save_item(NAME(m_tpi2_pa));
16321675   save_item(NAME(m_tpi2_pb));
16331676   save_item(NAME(m_cia_pa));
1634   save_item(NAME(m_ieee_dc));
1635   save_item(NAME(m_ieee_te));
16361677}
16371678
16381679
r18179r18180
17971838   MCFG_TPI6525_ADD(MOS6525_2_TAG, p500_tpi2_intf)
17981839   MCFG_ACIA6551_ADD(MOS6551A_TAG)
17991840   MCFG_MOS6526R1_ADD(MOS6526_TAG, VIC6567_CLOCK, 60, cia_intf)
1841   MCFG_DS75160A_ADD(DS75160A_TAG, ds75160a_intf)
1842   MCFG_DS75161A_ADD(DS75161A_TAG, ds75161a_intf)
18001843   MCFG_CBM_IEEE488_ADD(ieee488_intf, "c8050")
18011844   MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, NULL, NULL)
18021845   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
r18179r18180
18451888   MCFG_TPI6525_ADD(MOS6525_2_TAG, p500_tpi2_intf)
18461889   MCFG_ACIA6551_ADD(MOS6551A_TAG)
18471890   MCFG_MOS6526R1_ADD(MOS6526_TAG, VIC6569_CLOCK, 50, cia_intf)
1891   MCFG_DS75160A_ADD(DS75160A_TAG, ds75160a_intf)
1892   MCFG_DS75161A_ADD(DS75161A_TAG, ds75161a_intf)
18481893   MCFG_CBM_IEEE488_ADD(ieee488_intf, "c8050")
18491894   MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, NULL, NULL)
18501895   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
r18179r18180
18711916   MCFG_MACHINE_RESET_OVERRIDE(cbm2_state, cbm2)
18721917
18731918   // basic hardware
1874   MCFG_CPU_ADD(M6509_TAG, M6509, XTAL_18MHz/8)
1919   MCFG_CPU_ADD(M6509_TAG, M6509, XTAL_18MHz/9)
18751920   MCFG_CPU_PROGRAM_MAP(cbm2_mem)
18761921   MCFG_QUANTUM_PERFECT_CPU(M6509_TAG)
18771922
r18179r18180
18841929   MCFG_SCREEN_SIZE(768, 312)
18851930   MCFG_SCREEN_VISIBLE_AREA(0, 768-1, 0, 312-1)
18861931
1887   MCFG_MC6845_ADD(MC68B45_TAG, MC6845, XTAL_18MHz/8, lp_crtc_intf)
1932   MCFG_MC6845_ADD(MC68B45_TAG, MC6845, XTAL_18MHz/9, lp_crtc_intf)
18881933
18891934   // sound hardware
18901935   MCFG_SPEAKER_STANDARD_MONO("mono")
1891   MCFG_SOUND_ADD(MOS6851_TAG, SID6581, XTAL_18MHz/8)
1936   MCFG_SOUND_ADD(MOS6851_TAG, SID6581, XTAL_18MHz/9)
18921937   MCFG_SOUND_CONFIG(sid_intf)
18931938   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
18941939   MCFG_SOUND_ADD("dac", DAC, 0)
r18179r18180
18991944   MCFG_TPI6525_ADD(MOS6525_1_TAG, tpi1_intf)
19001945   MCFG_TPI6525_ADD(MOS6525_2_TAG, tpi2_intf)
19011946   MCFG_ACIA6551_ADD(MOS6551A_TAG)
1902   MCFG_MOS6526R1_ADD(MOS6526_TAG, XTAL_18MHz/8, 60, cia_intf)
1947   MCFG_MOS6526R1_ADD(MOS6526_TAG, XTAL_18MHz/9, 60, cia_intf)
1948   MCFG_DS75160A_ADD(DS75160A_TAG, ds75160a_intf)
1949   MCFG_DS75161A_ADD(DS75161A_TAG, ds75161a_intf)
19031950   MCFG_CBM_IEEE488_ADD(ieee488_intf, "c8050")
19041951   MCFG_PET_DATASSETTE_PORT_ADD(PET_DATASSETTE_PORT_TAG, datassette_intf, cbm_datassette_devices, NULL, NULL)
19051952   MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL)
19061953   MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL, NULL)
1907   MCFG_CBM2_EXPANSION_SLOT_ADD(CBM2_EXPANSION_SLOT_TAG, XTAL_18MHz/8, cbm2_expansion_cards, NULL, NULL)
1954   MCFG_CBM2_EXPANSION_SLOT_ADD(CBM2_EXPANSION_SLOT_TAG, XTAL_18MHz/9, cbm2_expansion_cards, NULL, NULL)
19081955   //MCFG_CBM2_USER_PORT_ADD(CBM2_USER_PORT_TAG, user_intf, cbm2_user_port_cards, NULL, NULL)
19091956   //MCFG_CBM2_SYSTEM_PORT_ADD(CBM2_SYSTEM_PORT_TAG, system_intf, cbm2_system_port_cards, NULL, NULL)
19101957
r18179r18180
19441991   MCFG_MACHINE_START_OVERRIDE(cbm2_state, cbm2_pal)
19451992
19461993   MCFG_DEVICE_REMOVE(MOS6526_TAG)
1947   MCFG_MOS6526R1_ADD(MOS6526_TAG, XTAL_18MHz/8, 50, cia_intf)
1994   MCFG_MOS6526R1_ADD(MOS6526_TAG, XTAL_18MHz/9, 50, cia_intf)
19481995MACHINE_CONFIG_END
19491996
19501997
r18179r18180
19762023   MCFG_FRAGMENT_ADD(cbm2lp_ntsc)
19772024
19782025   MCFG_DEVICE_REMOVE(MC68B45_TAG)
1979   MCFG_MC6845_ADD(MC68B45_TAG, MC6845, XTAL_18MHz/8, hp_crtc_intf)
2026   MCFG_MC6845_ADD(MC68B45_TAG, MC6845, XTAL_18MHz/9, hp_crtc_intf)
19802027
19812028   // devices
19822029   MCFG_DEVICE_REMOVE(MOS6525_2_TAG)
r18179r18180
20302077   MCFG_TPI6525_ADD(MOS6525_2_TAG, hp_tpi2_intf)
20312078
20322079   MCFG_DEVICE_REMOVE(MOS6526_TAG)
2033   MCFG_MOS6526R1_ADD(MOS6526_TAG, XTAL_18MHz/8, 50, cia_intf)
2080   MCFG_MOS6526R1_ADD(MOS6526_TAG, XTAL_18MHz/9, 50, cia_intf)
20342081MACHINE_CONFIG_END
20352082
20362083
trunk/hash/cbm2_cart.xml
r18179r18180
44
55   <software name="calcresu">
66      <description>Calc Result</description>
7      <year>198?</year>
7      <year>1983</year>
88      <publisher>Handic Software</publisher>
99     
1010      <part name="cart" interface="cbm2_cart">
11         <dataarea name="bank1" size="0x2000">
11         <dataarea name="bank3" size="0x2000">
1212            <rom name="calc_result-bx700.bin" size="0x2000" crc="4775ebb3" sha1="5c6928a9cd8a3ce6a1d11221292b832295d6543e" offset="0" />
1313         </dataarea>
1414      </part>

Previous 199869 Revisions Next


© 1997-2024 The MAME Team