Previous 15994 Revisions Next

r13220 Saturday 12th November, 2011 at 10:04:12 UTC by Curt Coder
Refactored the IEEE-488 bus to use slots. You can now connect up to 4 IEEE-488 floppy drives of your choice (C2040/C3040/C4040/C8050/C8250/SFD1001) to a Commodore PET or CBMB. [Curt Coder]
[src/emu/machine]6532riot.c 6532riot.h
[src/mess]mess.mak mess_dev.lst
[src/mess/drivers]cbmb.c pet.c tek405x.c vic20.c victor9k.c vixen.c
[src/mess/machine]c2031.c c2031.h c2040.c c2040.h c8280.c c8280.h c9060.c c9060.h cbmiec.c ieee488.c ieee488.h ieeestub.c interpod.c interpod.h vic1112.c vic1112.h

src/emu/machine/6532riot.c
r13219r13220
4646
4747void riot6532_device::update_irqstate()
4848{
49   int state = (m_irqstate & m_irqenable);
49   int irq = (m_irqstate & m_irqenable) ? ASSERT_LINE : CLEAR_LINE;
5050
51   if (!m_irq_func.isnull())
51   if (m_irq != irq)
5252   {
53      m_irq_func((state != 0) ? ASSERT_LINE : CLEAR_LINE);
53      m_irq_func(irq);
54      m_irq = irq;
5455   }
55   else
56   {
57      logerror("%s:6532RIOT chip #%d: no irq callback function\n", machine().describe_context(), m_index);
58   }
5956}
6057
6158
r13219r13220
229226      else
230227      {
231228         port->m_out = data;
232         if (!port->m_out_func.isnull())
233         {
234            port->m_out_func(0, data);
235         }
236         else
237         {
238            logerror("%s:6532RIOT chip %s: Port %c is being written to but has no handler. %02X\n", machine().describe_context(), tag(), 'A' + (offset & 1), data);
239         }
229         port->m_out_func(0, data);
240230      }
241231
242232      /* writes to port A need to update the PA7 state */
r13219r13220
311301      else
312302      {
313303         /* call the input callback if it exists */
314         if (!port->m_in_func.isnull())
315         {
316            port->m_in = port->m_in_func(0);
304         port->m_in = port->m_in_func(0);
317305
318            /* changes to port A need to update the PA7 state */
319            if (port == &m_port[0])
320            {
321               update_pa7_state();
322            }
323         }
324         else
306         /* changes to port A need to update the PA7 state */
307         if (port == &m_port[0])
325308         {
326            logerror("%s:6532RIOT chip %s: Port %c is being read but has no handler\n", machine().describe_context(), tag(), 'A' + (offset & 1));
309            update_pa7_state();
327310         }
328311
329312         /* apply the DDR to the result */
r13219r13220
440423//-------------------------------------------------
441424
442425riot6532_device::riot6532_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
443   : device_t(mconfig, RIOT6532, "6532 (RIOT)", tag, owner, clock)
426   : device_t(mconfig, RIOT6532, "6532 (RIOT)", tag, owner, clock),
427     m_irq(CLEAR_LINE)
444428{
445429}
446430
r13219r13220
506490
507491   save_item(NAME(m_irqstate));
508492   save_item(NAME(m_irqenable));
493   save_item(NAME(m_irq));
509494
510495   save_item(NAME(m_pa7dir));
511496   save_item(NAME(m_pa7prev));
src/emu/machine/6532riot.h
r13219r13220
9898
9999    UINT8           m_irqstate;
100100    UINT8           m_irqenable;
101   int            m_irq;
101102
102103    UINT8           m_pa7dir;     /* 0x80 = high-to-low, 0x00 = low-to-high */
103104    UINT8           m_pa7prev;
src/mess/machine/ieeestub.c
r13219r13220
1#include "ieee488.h"
2
3const device_type IEEE488_STUB = &device_creator<ieee488_stub_device>;
4
5//-------------------------------------------------
6//  device_config_complete - perform any
7//  operations now that the configuration is
8//  complete
9//-------------------------------------------------
10
11void ieee488_stub_device::device_config_complete()
12{
13   // inherit a copy of the static data
14   const ieee488_stub_interface *intf = reinterpret_cast<const ieee488_stub_interface *>(static_config());
15   if (intf != NULL)
16      *static_cast<ieee488_stub_interface *>(this) = *intf;
17
18   // or initialize to defaults if none provided
19   else
20   {
21      memset(&m_out_eoi_cb, 0, sizeof(m_out_eoi_cb));
22      memset(&m_out_dav_cb, 0, sizeof(m_out_dav_cb));
23      memset(&m_out_nrfd_cb, 0, sizeof(m_out_nrfd_cb));
24      memset(&m_out_ndac_cb, 0, sizeof(m_out_ndac_cb));
25      memset(&m_out_ifc_cb, 0, sizeof(m_out_ifc_cb));
26      memset(&m_out_srq_cb, 0, sizeof(m_out_srq_cb));
27      memset(&m_out_atn_cb, 0, sizeof(m_out_atn_cb));
28      memset(&m_out_ren_cb, 0, sizeof(m_out_ren_cb));
29   }
30}
31
32
33//**************************************************************************
34//  LIVE DEVICE
35//**************************************************************************
36
37//-------------------------------------------------
38//  ieee488_stub_device - constructor
39//-------------------------------------------------
40
41ieee488_stub_device::ieee488_stub_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
42   : device_t(mconfig, IEEE488_STUB, "IEEE488 driver stub", tag, owner, clock),
43     device_ieee488_interface(mconfig, *this)
44{
45}
46
47
48//-------------------------------------------------
49//  device_start - device-specific startup
50//-------------------------------------------------
51
52void ieee488_stub_device::device_start()
53{
54   // resolve callbacks
55    m_out_eoi_func.resolve(m_out_eoi_cb, *this);
56    m_out_dav_func.resolve(m_out_dav_cb, *this);
57    m_out_nrfd_func.resolve(m_out_nrfd_cb, *this);
58    m_out_ndac_func.resolve(m_out_ndac_cb, *this);
59    m_out_ifc_func.resolve(m_out_ifc_cb, *this);
60    m_out_srq_func.resolve(m_out_srq_cb, *this);
61    m_out_atn_func.resolve(m_out_atn_cb, *this);
62    m_out_ren_func.resolve(m_out_ren_cb, *this);
63}
64
65
66//-------------------------------------------------
67//  ieee488_eoi -
68//-------------------------------------------------
69
70void ieee488_stub_device::ieee488_eoi(int state)
71{
72   m_out_eoi_func(state);
73}
74
75
76//-------------------------------------------------
77//  ieee488_dav -
78//-------------------------------------------------
79
80void ieee488_stub_device::ieee488_dav(int state)
81{
82   m_out_dav_func(state);
83}
84
85
86//-------------------------------------------------
87//  ieee488_nrfd -
88//-------------------------------------------------
89
90void ieee488_stub_device::ieee488_nrfd(int state)
91{
92   m_out_nrfd_func(state);
93}
94
95
96//-------------------------------------------------
97//  ieee488_ndac -
98//-------------------------------------------------
99
100void ieee488_stub_device::ieee488_ndac(int state)
101{
102   m_out_ndac_func(state);
103}
104
105
106//-------------------------------------------------
107//  ieee488_ifc -
108//-------------------------------------------------
109
110void ieee488_stub_device::ieee488_ifc(int state)
111{
112   m_out_ifc_func(state);
113}
114
115
116//-------------------------------------------------
117//  ieee488_srq -
118//-------------------------------------------------
119
120void ieee488_stub_device::ieee488_srq(int state)
121{
122   m_out_srq_func(state);
123}
124
125
126//-------------------------------------------------
127//  ieee488_atn -
128//-------------------------------------------------
129
130void ieee488_stub_device::ieee488_atn(int state)
131{
132   m_out_atn_func(state);
133}
134
135
136//-------------------------------------------------
137//  ieee488_ren -
138//-------------------------------------------------
139
140void ieee488_stub_device::ieee488_ren(int state)
141{
142   m_out_ren_func(state);
143}
src/mess/machine/cbmiec.c
r13219r13220
400400         entry = entry->next();
401401      }
402402
403      if (LOG) logerror("CBM IEC: SRQ %u ATN %u CLK %u DATA %u RESET %u\n", get_signal(SRQ),get_signal(ATN),get_signal(CLK),get_signal(DATA),get_signal(RESET));
403      if (LOG) logerror("CBM IEC: SRQ %u ATN %u CLK %u DATA %u RESET %u\n",
404         get_signal(SRQ), get_signal(ATN), get_signal(CLK), get_signal(DATA), get_signal(RESET));
404405   }
405406}
406407
src/mess/machine/c2031.c
r13219r13220
3636
3737const device_type C2031 = &device_creator<c2031_device>;
3838
39
3940//-------------------------------------------------
4041//  device_config_complete - perform any
4142//  operations now that the configuration is
r13219r13220
4950
5051
5152//-------------------------------------------------
52//  static_set_config - configuration helper
53//-------------------------------------------------
54
55void c2031_device::static_set_config(device_t &device, int address)
56{
57   c2031_device &c2031 = downcast<c2031_device &>(device);
58
59   assert((address > 7) && (address < 12));
60
61   c2031.m_address = address;
62}
63
64
65//-------------------------------------------------
6653//  ROM( c2031 )
6754//-------------------------------------------------
6855
r13219r13220
476463     m_via1(*this, M6522_1_TAG),
477464     m_ga(*this, C64H156_TAG),
478465     m_image(*this, FLOPPY_0),
479     m_bus(*this->owner(), IEEE488_TAG),
480466     m_nrfd_out(1),
481467     m_ndac_out(1),
482468     m_atna(1),
r13219r13220
492478
493479void c2031_device::device_start()
494480{
481    m_bus = owner()->owner()->subdevice<ieee488_device>(IEEE488_TAG);
482
483   // get bus address
484   ieee488_slot_device *slot = downcast<ieee488_slot_device*>(owner());
485   m_address = slot->get_address() - 8;
486
495487   // map ROM
496488   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
497489   program->install_rom(0x8000, 0xbfff, 0, 0x4000, subregion(M6502_TAG)->base());
src/mess/machine/c2031.h
r13219r13220
2626
2727
2828//**************************************************************************
29//  MACROS / CONSTANTS
30//**************************************************************************
31
32#define C2031_TAG         "c2031"
33
34
35
36//**************************************************************************
37//  INTERFACE CONFIGURATION MACROS
38//**************************************************************************
39
40#define MCFG_C2031_ADD(_tag, _address) \
41    MCFG_DEVICE_ADD(_tag, C2031, 0) \
42   c2031_device::static_set_config(*device, _address);
43
44
45
46//**************************************************************************
4729//  TYPE DEFINITIONS
4830//**************************************************************************
4931
r13219r13220
7052   DECLARE_READ8_MEMBER( via1_pb_r );
7153   DECLARE_WRITE8_MEMBER( via1_pb_w );
7254   DECLARE_WRITE_LINE_MEMBER( byte_w );
73   // inline configuration helpers
74   static void static_set_config(device_t &device, int address);
7555
7656   // optional information overrides
7757   virtual const rom_entry *device_rom_region() const;
7858   virtual machine_config_constructor device_mconfig_additions() const;
59
7960protected:
8061    // device-level overrides
8162    virtual void device_start();
r13219r13220
9374   required_device<via6522_device> m_via1;
9475   required_device<c64h156_device> m_ga;
9576   required_device<device_t> m_image;
96   required_device<ieee488_device> m_bus;
77   ieee488_device *m_bus;
9778
9879   // IEEE-488 bus
9980   int m_nrfd_out;            // not ready for data
r13219r13220
10182   int m_atna;               // attention acknowledge
10283
10384   // interrupts
104   int m_via0_irq;                     // VIA #0 interrupt request
105   int m_via1_irq;                     // VIA #1 interrupt request
85   int m_via0_irq;            // VIA #0 interrupt request
86   int m_via1_irq;            // VIA #1 interrupt request
10687
10788   int m_address;
10889};
src/mess/machine/vic1112.c
r13219r13220
3939
4040
4141//-------------------------------------------------
42//  IEEE488_INTERFACE( vic1112_ieee488_intf )
42//  IEEE488_INTERFACE( ieee488_intf )
4343//-------------------------------------------------
4444
45IEEE488_INTERFACE( vic1112_ieee488_intf )
45static SLOT_INTERFACE_START( cbm_ieee488_devices )
46   SLOT_INTERFACE("c2040", C2040)
47   SLOT_INTERFACE("c3040", C3040)
48   SLOT_INTERFACE("c4040", C4040)
49   SLOT_INTERFACE("c8050", C8050)
50   SLOT_INTERFACE("c8250", C8250)
51   SLOT_INTERFACE("sfd1001", SFD1001)
52   SLOT_INTERFACE("c2031", C2031)
53   SLOT_INTERFACE("c8280", C8280)
54   SLOT_INTERFACE("c9060", C9060)
55   SLOT_INTERFACE("c9090", C9090)
56SLOT_INTERFACE_END
57
58IEEE488_INTERFACE( ieee488_intf )
4659{
4760   DEVCB_NULL,
4861   DEVCB_NULL,
4962   DEVCB_NULL,
5063   DEVCB_NULL,
5164   DEVCB_NULL,
52   DEVCB_DEVICE_LINE_MEMBER(VIC1112_TAG, vic1112_device, srq_w),
65   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, vic1112_device, srq_w),
5366   DEVCB_NULL,
5467   DEVCB_NULL
5568};
r13219r13220
274287static MACHINE_CONFIG_FRAGMENT( vic1112 )
275288   MCFG_VIA6522_ADD(M6522_0_TAG, 0, via0_intf)
276289   MCFG_VIA6522_ADD(M6522_1_TAG, 0, via1_intf)
290
291   MCFG_IEEE488_BUS_ADD(ieee488_intf)
292   MCFG_IEEE488_SLOT_ADD("ieee8", 8, cbm_ieee488_devices, NULL, NULL)
293   MCFG_IEEE488_SLOT_ADD("ieee9", 9, cbm_ieee488_devices, NULL, NULL)
294   MCFG_IEEE488_SLOT_ADD("ieee10", 10, cbm_ieee488_devices, NULL, NULL)
295   MCFG_IEEE488_SLOT_ADD("ieee11", 11, cbm_ieee488_devices, NULL, NULL)
277296MACHINE_CONFIG_END
278297
279298
r13219r13220
301320    : device_t(mconfig, VIC1112, "VIC1112", tag, owner, clock),
302321     m_via0(*this, M6522_0_TAG),
303322     m_via1(*this, M6522_1_TAG),
304     m_bus(*this->owner(), IEEE488_TAG)
323     m_bus(*this, IEEE488_TAG)
305324{
306325}
307326
src/mess/machine/c2040.c
r13219r13220
1010/*
1111
1212    TODO:
13   
14   - 8050/8250 only work when debugger is active!?
1315
1416    - 2040 DOS 1 FDC rom (jumps to 104d while getting block header)
1517
r13219r13220
110112
111113
112114//-------------------------------------------------
113//  static_set_config - configuration helper
114//-------------------------------------------------
115
116void base_c2040_device::static_set_config(device_t &device, int address)
117{
118   base_c2040_device &c2040 = downcast<base_c2040_device &>(device);
119
120   assert((address > 7) && (address < 12));
121
122   c2040.m_address = address - 8;
123}
124
125
126//-------------------------------------------------
127115//  ROM( c2040 )
128116//-------------------------------------------------
129117
r13219r13220
268256   AM_RANGE(0x2000, 0x23ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share2")
269257   AM_RANGE(0x3000, 0x33ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share3")
270258   AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share4")
271   AM_RANGE(0x5000, 0x7fff) // AM_ROM
259   AM_RANGE(0x5000, 0x7fff) AM_ROM AM_REGION(M6502_TAG, 0)
272260ADDRESS_MAP_END
273261
274262
r13219r13220
285273   AM_RANGE(0x0800, 0x0bff) AM_RAM AM_SHARE("share2")
286274   AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_SHARE("share3")
287275   AM_RANGE(0x1000, 0x13ff) AM_RAM AM_SHARE("share4")
288   AM_RANGE(0x1c00, 0x1fff) // AM_ROM 6530
276   AM_RANGE(0x1c00, 0x1fff) AM_ROM AM_REGION(M6504_TAG, 0)
289277ADDRESS_MAP_END
290278
291279
r13219r13220
302290   AM_RANGE(0x2000, 0x23ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share2")
303291   AM_RANGE(0x3000, 0x33ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share3")
304292   AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share4")
305   AM_RANGE(0xc000, 0xffff) // AM_ROM
293   AM_RANGE(0xc000, 0xffff) AM_ROM AM_REGION(M6502_TAG, 0)
306294ADDRESS_MAP_END
307295
308296
r13219r13220
319307   AM_RANGE(0x0800, 0x0bff) AM_RAM AM_SHARE("share2")
320308   AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_SHARE("share3")
321309   AM_RANGE(0x1000, 0x13ff) AM_RAM AM_SHARE("share4")
322   AM_RANGE(0x1c00, 0x1fff) // AM_ROM 6530
310   AM_RANGE(0x1c00, 0x1fff) AM_ROM AM_REGION(M6504_TAG, 0)
323311ADDRESS_MAP_END
324312
325313
r13219r13220
336324   AM_RANGE(0x0800, 0x0bff) AM_RAM AM_SHARE("share2")
337325   AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_SHARE("share3")
338326   AM_RANGE(0x1000, 0x13ff) AM_RAM AM_SHARE("share4")
339   AM_RANGE(0x1800, 0x1fff) // AM_ROM
327   AM_RANGE(0x1800, 0x1fff) AM_ROM AM_REGION(M6504_TAG, 0)
340328ADDRESS_MAP_END
341329
342330
r13219r13220
14651453     m_via(*this, M6522_TAG),
14661454     m_image0(*this, FLOPPY_0),
14671455     m_image1(*this, FLOPPY_1),
1468     m_bus(*this->owner(), IEEE488_TAG),
14691456     m_drive(0),
14701457     m_side(0),
14711458     m_rfdo(1),
r13219r13220
15441531
15451532void base_c2040_device::device_start()
15461533{
1547   address_space *main = m_maincpu->memory().space(AS_PROGRAM);
1548   address_space *fdc = m_fdccpu->memory().space(AS_PROGRAM);
1534    m_bus = owner()->owner()->subdevice<ieee488_device>(IEEE488_TAG);
15491535
1536   // get bus address
1537   ieee488_slot_device *slot = downcast<ieee488_slot_device*>(owner());
1538   m_address = slot->get_address() - 8;
1539
15501540   m_bit_timer = timer_alloc();
15511541
15521542   switch (m_variant)
15531543   {
15541544   default:
1555      main->install_rom(0x5000, 0x7fff, subregion(M6502_TAG)->base());
1556      fdc->install_rom(0x1c00, 0x1fff, subregion(M6504_TAG)->base());
1557
15581545      initialize(2);
15591546      break;
15601547
1561   case base_c2040_device::TYPE_8050:
1562   case base_c2040_device::TYPE_8250:
1563      main->install_rom(0xc000, 0xffff, subregion(M6502_TAG)->base());
1564      fdc->install_rom(0x1c00, 0x1fff, subregion(M6504_TAG)->base());
1565
1566      initialize(2);
1567      break;
1568
15691548   case base_c2040_device::TYPE_SFD1001:
1570      main->install_rom(0xc000, 0xffff, subregion(M6502_TAG)->base());
1571      fdc->install_rom(0x1800, 0x1fff, subregion(M6504_TAG)->base());
1572
15731549      initialize(1);
15741550      break;
15751551   }
src/mess/machine/vic1112.h
r13219r13220
2020#include "cpu/m6502/m6502.h"
2121#include "machine/6522via.h"
2222#include "machine/ieee488.h"
23#include "machine/devhelpr.h"
23#include "machine/c2031.h"
24#include "machine/c2040.h"
25#include "machine/c8280.h"
26#include "machine/c9060.h"
2427
2528
2629
r13219r13220
3639//  INTERFACE CONFIGURATION MACROS
3740//**************************************************************************
3841
39#define MCFG_VIC1112_ADD(_daisy) \
40    MCFG_DEVICE_ADD(VIC1112_TAG, VIC1112, 0) \
41   MCFG_IEEE488_CONFIG_ADD(_daisy, vic1112_ieee488_intf)
42#define MCFG_VIC1112_ADD() \
43    MCFG_DEVICE_ADD(VIC1112_TAG, VIC1112, 0)
4244
43#define VIC1112_INTERFACE(name) \
44   const vic1112_interface (name) =
4545
4646
47
4847//**************************************************************************
4948//  TYPE DEFINITIONS
5049//**************************************************************************
r13219r13220
6766
6867   DECLARE_WRITE_LINE_MEMBER( srq_w );
6968
70   // not really public, but won't compile otherwise
69   // not really public
7170   DECLARE_WRITE_LINE_MEMBER( via0_irq_w );
7271   DECLARE_READ8_MEMBER( via0_pb_r );
7372   DECLARE_WRITE8_MEMBER( via0_pb_w );
r13219r13220
103102extern const device_type VIC1112;
104103
105104
106// IEEE-488 interface
107extern const ieee488_stub_interface vic1112_ieee488_intf;
108105
109
110
111106#endif
src/mess/machine/c2040.h
r13219r13220
2727
2828
2929//**************************************************************************
30//  MACROS / CONSTANTS
31//**************************************************************************
32
33#define C2040_TAG         "c2040"
34#define C3040_TAG         "c3040"
35#define C4040_TAG         "c4040"
36#define C8050_TAG         "c8050"
37#define C8250_TAG         "c8250"
38#define SFD1001_TAG         "sfd1001"
39
40
41
42//**************************************************************************
43//  INTERFACE CONFIGURATION MACROS
44//**************************************************************************
45
46#define MCFG_C2040_ADD(_tag, _address) \
47    MCFG_DEVICE_ADD(_tag, C2040, 0) \
48   base_c2040_device::static_set_config(*device, _address);
49
50
51#define MCFG_C3040_ADD(_tag, _address) \
52    MCFG_DEVICE_ADD(_tag, C3040, 0) \
53   base_c2040_device::static_set_config(*device, _address);
54
55
56#define MCFG_C4040_ADD(_tag, _address) \
57    MCFG_DEVICE_ADD(_tag, C4040, 0) \
58   base_c2040_device::static_set_config(*device, _address);
59
60
61#define MCFG_C8050_ADD(_tag, _address) \
62    MCFG_DEVICE_ADD(_tag, C8050, 0) \
63   base_c2040_device::static_set_config(*device, _address);
64
65
66#define MCFG_C8250_ADD(_tag, _address) \
67    MCFG_DEVICE_ADD(_tag, C8250, 0) \
68   base_c2040_device::static_set_config(*device, _address);
69
70
71#define MCFG_SFD1001_ADD(_tag, _address) \
72    MCFG_DEVICE_ADD(_tag, SFD1001, 0) \
73   base_c2040_device::static_set_config(*device, _address);
74
75
76
77//**************************************************************************
7830//  TYPE DEFINITIONS
7931//**************************************************************************
8032
r13219r13220
12274   DECLARE_READ8_MEMBER( c8050_miot_pb_r );
12375   DECLARE_WRITE8_MEMBER( c8050_miot_pb_w );
12476
125   // inline configuration helpers
126   static void static_set_config(device_t &device, int address);
127
12877   // optional information overrides
12978   virtual const rom_entry *device_rom_region() const;
13079   virtual machine_config_constructor device_mconfig_additions() const;
r13219r13220
156105   required_device<via6522_device> m_via;
157106   required_device<device_t> m_image0;
158107   optional_device<device_t> m_image1;
159   required_device<ieee488_device> m_bus;
108   ieee488_device *m_bus;
160109
161110   struct {
162111      // motors
src/mess/machine/c8280.c
r13219r13220
2828
2929const device_type C8280 = &device_creator<c8280_device>;
3030
31
3132//-------------------------------------------------
3233//  device_config_complete - perform any
3334//  operations now that the configuration is
r13219r13220
4142
4243
4344//-------------------------------------------------
44//  static_set_config - configuration helper
45//-------------------------------------------------
46
47void c8280_device::static_set_config(device_t &device, int address)
48{
49   c8280_device &c8280 = downcast<c8280_device &>(device);
50
51   assert((address > 7) && (address < 12));
52
53   c8280.m_address = address - 8;
54}
55
56
57//-------------------------------------------------
5845//  ROM( c8280 )
5946//-------------------------------------------------
6047
r13219r13220
197184     m_riot0(*this, M6532_0_TAG),
198185     m_riot1(*this, M6532_1_TAG),
199186     m_image0(*this, FLOPPY_0),
200     m_image1(*this, FLOPPY_1),
201     m_bus(*this->owner(), IEEE488_TAG)
187     m_image1(*this, FLOPPY_1)
202188{
203189}
204190
r13219r13220
209195
210196void c8280_device::device_start()
211197{
198    m_bus = owner()->owner()->subdevice<ieee488_device>(IEEE488_TAG);
199
200   // get bus address
201   ieee488_slot_device *slot = downcast<ieee488_slot_device*>(owner());
202   m_address = slot->get_address() - 8;
203
212204   address_space *main = m_maincpu->memory().space(AS_PROGRAM);
213205   address_space *fdc = m_fdccpu->memory().space(AS_PROGRAM);
214206
src/mess/machine/c8280.h
r13219r13220
2323
2424
2525//**************************************************************************
26//  MACROS / CONSTANTS
27//**************************************************************************
28
29#define C8280_TAG         "c8280"
30
31
32
33//**************************************************************************
34//  INTERFACE CONFIGURATION MACROS
35//**************************************************************************
36
37#define MCFG_C8280_ADD(_tag, _address) \
38    MCFG_DEVICE_ADD(_tag, C8280, 0) \
39   c8280_device::static_set_config(*device, _address);
40
41
42
43//**************************************************************************
4426//  TYPE DEFINITIONS
4527//**************************************************************************
4628
r13219r13220
5335    // construction/destruction
5436    c8280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
5537
56   // inline configuration helpers
57   static void static_set_config(device_t &device, int address);
58
5938   // optional information overrides
6039   virtual const rom_entry *device_rom_region() const;
6140   virtual machine_config_constructor device_mconfig_additions() const;
r13219r13220
7756   required_device<riot6532_device> m_riot1;
7857   required_device<device_t> m_image0;
7958   required_device<device_t> m_image1;
80   required_device<ieee488_device> m_bus;
59   ieee488_device *m_bus;
8160
8261   int m_address;
8362};
src/mess/machine/interpod.c
r13219r13220
7777//  DEVICE CONFIGURATION
7878//**************************************************************************
7979
80
8180//-------------------------------------------------
82//  IEEE488_INTERFACE( interpod_ieee488_intf )
81//  IEEE488_INTERFACE( ieee488_intf )
8382//-------------------------------------------------
8483
85IEEE488_INTERFACE( interpod_ieee488_intf )
84static SLOT_INTERFACE_START( cbm_ieee488_devices )
85   SLOT_INTERFACE("c2040", C2040)
86   SLOT_INTERFACE("c3040", C3040)
87   SLOT_INTERFACE("c4040", C4040)
88   SLOT_INTERFACE("c8050", C8050)
89   SLOT_INTERFACE("c8250", C8250)
90   SLOT_INTERFACE("sfd1001", SFD1001)
91   SLOT_INTERFACE("c2031", C2031)
92   SLOT_INTERFACE("c8280", C8280)
93   SLOT_INTERFACE("c9060", C9060)
94   SLOT_INTERFACE("c9090", C9090)
95SLOT_INTERFACE_END
96
97static IEEE488_INTERFACE( ieee488_intf )
8698{
8799   DEVCB_NULL,
88100   DEVCB_NULL,
r13219r13220
196208   MCFG_VIA6522_ADD(R6522_TAG, 1000000, via_intf)
197209   MCFG_RIOT6532_ADD(R6532_TAG, 1000000, riot_intf)
198210   MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf)
211
212   MCFG_IEEE488_BUS_ADD(ieee488_intf)
213   MCFG_IEEE488_SLOT_ADD("ieee8", 8, cbm_ieee488_devices, NULL, NULL)
214   MCFG_IEEE488_SLOT_ADD("ieee9", 9, cbm_ieee488_devices, NULL, NULL)
215   MCFG_IEEE488_SLOT_ADD("ieee10", 10, cbm_ieee488_devices, NULL, NULL)
216   MCFG_IEEE488_SLOT_ADD("ieee11", 11, cbm_ieee488_devices, NULL, NULL)
199217MACHINE_CONFIG_END
200218
201219
r13219r13220
226244     m_riot(*this, R6532_TAG),
227245     m_acia(*this, MC6850_TAG),
228246     m_iec(*this->owner(), CBM_IEC_TAG),
229     m_ieee(*this->owner(), IEEE488_TAG)
247     m_ieee(*this, IEEE488_TAG)
230248{
231249}
232250
src/mess/machine/interpod.h
r13219r13220
1010#include "machine/6522via.h"
1111#include "machine/6532riot.h"
1212#include "machine/6850acia.h"
13#include "machine/c2031.h"
14#include "machine/c2040.h"
15#include "machine/c8280.h"
16#include "machine/c9060.h"
1317#include "machine/cbmiec.h"
1418#include "machine/ieee488.h"
1519
r13219r13220
2731//  INTERFACE CONFIGURATION MACROS
2832//**************************************************************************
2933
30#define MCFG_INTERPOD_ADD(_daisy) \
31    MCFG_DEVICE_ADD(INTERPOD_TAG, INTERPOD, 0) \
32   MCFG_IEEE488_CONFIG_ADD(_daisy, interpod_ieee488_intf)
34#define MCFG_INTERPOD_ADD() \
35    MCFG_DEVICE_ADD(INTERPOD_TAG, INTERPOD, 0)
3336
3437
3538
r13219r13220
6972extern const device_type INTERPOD;
7073
7174
72// IEEE-488 interface
73extern const ieee488_stub_interface interpod_ieee488_intf;
7475
75
76
7776#endif
src/mess/machine/c9060.c
r13219r13220
4545
4646
4747//-------------------------------------------------
48//  static_set_config - configuration helper
49//-------------------------------------------------
50
51void base_c9060_device::static_set_config(device_t &device, int address)
52{
53   base_c9060_device &c9060 = downcast<base_c9060_device &>(device);
54
55   assert((address > 7) && (address < 12));
56
57   c9060.m_address = address - 8;
58}
59
60
61//-------------------------------------------------
6248//  ROM( c9060 )
6349//-------------------------------------------------
6450
r13219r13220
493479     m_riot0(*this, M6532_0_TAG),
494480     m_riot1(*this, M6532_1_TAG),
495481     m_via(*this, M6522_TAG),
496     m_bus(*this->owner(), IEEE488_TAG),
497482     m_variant(variant)
498483{
499484}
r13219r13220
521506
522507void base_c9060_device::device_start()
523508{
509    m_bus = owner()->owner()->subdevice<ieee488_device>(IEEE488_TAG);
510
511   // get bus address
512   ieee488_slot_device *slot = downcast<ieee488_slot_device*>(owner());
513   m_address = slot->get_address() - 8;
514
524515   address_space *main = m_maincpu->memory().space(AS_PROGRAM);
525516   address_space *hdc = m_hdccpu->memory().space(AS_PROGRAM);
526517
src/mess/machine/c9060.h
r13219r13220
2424
2525
2626//**************************************************************************
27//  MACROS / CONSTANTS
28//**************************************************************************
29
30#define C9060_TAG         "c9060"
31#define C9090_TAG         "c9090"
32
33
34
35//**************************************************************************
36//  INTERFACE CONFIGURATION MACROS
37//**************************************************************************
38
39#define MCFG_C9060_ADD(_tag, _address) \
40    MCFG_DEVICE_ADD(_tag, C9060, 0) \
41   base_c9060_device::static_set_config(*device, _address);
42
43
44#define MCFG_C9090_ADD(_tag, _address) \
45    MCFG_DEVICE_ADD(_tag, C9090, 0) \
46   base_c9060_device::static_set_config(*device, _address);
47
48
49
50//**************************************************************************
5127//  TYPE DEFINITIONS
5228//**************************************************************************
5329
r13219r13220
6844   // construction/destruction
6945    base_c9060_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant);
7046
71   // inline configuration helpers
72   static void static_set_config(device_t &device, int address);
73
7447   // optional information overrides
7548   virtual const rom_entry *device_rom_region() const;
7649   virtual machine_config_constructor device_mconfig_additions() const;
r13219r13220
10679   required_device<riot6532_device> m_riot0;
10780   required_device<riot6532_device> m_riot1;
10881   required_device<via6522_device> m_via;
109   required_device<ieee488_device> m_bus;
82   ieee488_device *m_bus;
11083
11184   // IEEE-488 bus
11285   int m_address;                  // bus address
src/mess/machine/ieee488.c
r13219r13220
99**********************************************************************/
1010
1111#include "ieee488.h"
12#include "machine/devhelpr.h"
1312
1413
1514
r13219r13220
2928//**************************************************************************
3029
3130const device_type IEEE488 = &device_creator<ieee488_device>;
31const device_type IEEE488_SLOT = &device_creator<ieee488_slot_device>;
3232
3333
34
3435//**************************************************************************
3536//  DEVICE INTERFACE
3637//**************************************************************************
r13219r13220
4041//-------------------------------------------------
4142
4243device_ieee488_interface::device_ieee488_interface(const machine_config &mconfig, device_t &device)
43   : device_interface(device)
44   : device_slot_card_interface(mconfig, device)
4445{
4546}
4647
r13219r13220
5354{
5455}
5556
57
58
59//**************************************************************************
60//  LIVE DEVICE
61//**************************************************************************
62
5663//-------------------------------------------------
64//  ieee488_slot_device - constructor
65//-------------------------------------------------
66
67ieee488_slot_device::ieee488_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
68        device_t(mconfig, IEEE488_SLOT, "IEEE-488 slot", tag, owner, clock),
69      device_slot_interface(mconfig, *this)
70{
71}
72
73
74//-------------------------------------------------
75//  static_set_slot -
76//-------------------------------------------------
77
78void ieee488_slot_device::static_set_slot(device_t &device, int address)
79{
80   ieee488_slot_device &ieee488_card = dynamic_cast<ieee488_slot_device &>(device);
81   ieee488_card.m_address = address;
82}
83
84
85//-------------------------------------------------
86//  get_address -
87//-------------------------------------------------
88
89int ieee488_slot_device::get_address()
90{
91   return m_address;
92}
93
94
95//-------------------------------------------------
96//  device_start - device-specific startup
97//-------------------------------------------------
98
99void ieee488_slot_device::device_start()
100{
101   m_bus = owner()->subdevice<ieee488_device>(IEEE488_TAG);
102   device_ieee488_interface *dev = dynamic_cast<device_ieee488_interface *>(get_card_device());
103   if (dev) m_bus->add_device(get_card_device());
104}
105
106
107
108//**************************************************************************
109//  DEVICE CONFIGURATION
110//**************************************************************************
111
112//-------------------------------------------------
57113//  device_config_complete - perform any
58114//  operations now that the configuration is
59115//  complete
r13219r13220
62118void ieee488_device::device_config_complete()
63119{
64120   // inherit a copy of the static data
65   const ieee488_config *intf = reinterpret_cast<const ieee488_config *>(static_config());
121   const ieee488_interface *intf = reinterpret_cast<const ieee488_interface *>(static_config());
66122   if (intf != NULL)
67      *static_cast<ieee488_config *>(this) = *intf;
123      *static_cast<ieee488_interface *>(this) = *intf;
68124
69125   // or initialize to defaults if none provided
70126   else
71127   {
72      fatalerror("Daisy chain not provided!");
128      memset(&m_out_eoi_cb, 0, sizeof(m_out_eoi_cb));
129      memset(&m_out_dav_cb, 0, sizeof(m_out_dav_cb));
130      memset(&m_out_nrfd_cb, 0, sizeof(m_out_nrfd_cb));
131      memset(&m_out_ndac_cb, 0, sizeof(m_out_ndac_cb));
132      memset(&m_out_ifc_cb, 0, sizeof(m_out_ifc_cb));
133      memset(&m_out_srq_cb, 0, sizeof(m_out_srq_cb));
134      memset(&m_out_atn_cb, 0, sizeof(m_out_atn_cb));
135      memset(&m_out_ren_cb, 0, sizeof(m_out_ren_cb));
73136   }
74
75   m_daisy = intf;
76137}
77138
78139
r13219r13220
89150{
90151   bool changed = false;
91152
92   for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
153   if (device == this)
93154   {
94      if (!strcmp(daisy->m_device->tag(), device->tag()))
155      if (m_line[signal] != state)
95156      {
96         if (daisy->m_line[signal] != state)
157         if (LOG) logerror("%s IEEE488: '%s' %s %u\n", machine().describe_context(), tag(), SIGNAL_NAME[signal], state);
158         m_line[signal] = state;
159         changed = true;
160      }
161   }
162   else
163   {
164      daisy_entry *entry = m_device_list.first();
165     
166      while (entry)
167      {
168         if (!strcmp(entry->m_device->tag(), device->tag()))
97169         {
98            if (LOG) logerror("IEEE488: '%s' %s %u\n", device->tag(), SIGNAL_NAME[signal], state);
99            daisy->m_line[signal] = state;
100            changed = true;
170            if (entry->m_line[signal] != state)
171            {
172               if (LOG) logerror("%s IEEE488: '%s' %s %u\n", machine().describe_context(), device->tag(), SIGNAL_NAME[signal], state);
173               entry->m_line[signal] = state;
174               changed = true;
175            }
101176         }
177         
178         entry = entry->next();
102179      }
103180   }
104181
105182   if (changed)
106183   {
107      for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
184      switch (signal)
108185      {
186      case EOI:   m_out_eoi_func(state);   break;
187      case DAV:   m_out_dav_func(state);   break;
188      case NRFD:   m_out_nrfd_func(state);   break;
189      case NDAC:   m_out_ndac_func(state);   break;
190      case IFC:   m_out_ifc_func(state);   break;
191      case SRQ:   m_out_srq_func(state);   break;
192      case ATN:   m_out_atn_func(state);   break;
193      case REN:   m_out_ren_func(state);   break;
194      }
195
196      daisy_entry *entry = m_device_list.first();
197     
198      while (entry)
199      {
109200         switch (signal)
110201         {
111202         case EOI:
112            daisy->m_interface->ieee488_eoi(state);
203            entry->m_interface->ieee488_eoi(state);
113204            break;
114205
115206         case DAV:
116            daisy->m_interface->ieee488_dav(state);
207            entry->m_interface->ieee488_dav(state);
117208            break;
118209
119210         case NRFD:
120            daisy->m_interface->ieee488_nrfd(state);
211            entry->m_interface->ieee488_nrfd(state);
121212            break;
122213
123214         case NDAC:
124            daisy->m_interface->ieee488_ndac(state);
215            entry->m_interface->ieee488_ndac(state);
125216            break;
126217
127218         case IFC:
128            daisy->m_interface->ieee488_ifc(state);
219            entry->m_interface->ieee488_ifc(state);
129220            break;
130221
131222         case SRQ:
132            daisy->m_interface->ieee488_srq(state);
223            entry->m_interface->ieee488_srq(state);
133224            break;
134225
135226         case ATN:
136            daisy->m_interface->ieee488_atn(state);
227            entry->m_interface->ieee488_atn(state);
137228            break;
138229
139230         case REN:
140            daisy->m_interface->ieee488_ren(state);
231            entry->m_interface->ieee488_ren(state);
141232            break;
142233         }
234
235         entry = entry->next();
143236      }
144237
145      if (LOG) logerror("IEEE-488: EOI %u DAV %u NRFD %u NDAC %u IFC %u SRQ %u ATN %u REN %u DIO %02x\n",
238      if (LOG) logerror("IEEE488: EOI %u DAV %u NRFD %u NDAC %u IFC %u SRQ %u ATN %u REN %u DIO %02x\n",
146239         get_signal(EOI), get_signal(DAV), get_signal(NRFD), get_signal(NDAC),
147240         get_signal(IFC), get_signal(SRQ), get_signal(ATN), get_signal(REN), get_data());
148241   }
r13219r13220
155248
156249inline int ieee488_device::get_signal(int signal)
157250{
158   int state = 1;
251   int state = m_line[signal];
159252
160   for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
253   if (state)
161254   {
162      if (!daisy->m_line[signal])
255      daisy_entry *entry = m_device_list.first();
256     
257      while (entry)
163258      {
164         state = 0;
165         break;
259         if (!entry->m_line[signal])
260         {
261            state = 0;
262            break;
263         }
264         
265         entry = entry->next();
166266      }
167267   }
168
268   
169269   return state;
170270}
171271
r13219r13220
176276
177277inline void ieee488_device::set_data(device_t *device, UINT8 data)
178278{
179   for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
279   if (device == this)
180280   {
181      if (!strcmp(daisy->m_device->tag(), device->tag()))
281      if (LOG) logerror("%s IEEE488: '%s' DIO %02x\n", machine().describe_context(), tag(), data);
282     
283      m_dio = data;
284   }
285   else
286   {   
287      daisy_entry *entry = m_device_list.first();
288     
289      while (entry)
182290      {
183         if (daisy->m_dio != data)
291         if (!strcmp(entry->m_device->tag(), device->tag()))
184292         {
185            if (LOG) logerror("IEEE488: '%s' DIO %02x\n", device->tag(), data);
186            daisy->m_dio = data;
293            if (entry->m_dio != data)
294            {
295               if (LOG) logerror("%s IEEE488: '%s' DIO %02x\n", machine().describe_context(), device->tag(), data);
296               entry->m_dio = data;
297            }
187298         }
299         
300         entry = entry->next();
188301      }
189302   }
190303}
r13219r13220
196309
197310inline UINT8 ieee488_device::get_data()
198311{
199   UINT8 data = 0xff;
312   UINT8 data = m_dio;
200313
201   for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next)
314   daisy_entry *entry = m_device_list.first();
315   
316   while (entry)
202317   {
203      data &= daisy->m_dio;
318      data &= entry->m_dio;
319         
320      entry = entry->next();
204321   }
205
322     
206323   return data;
207324}
208325
r13219r13220
217334//-------------------------------------------------
218335
219336ieee488_device::ieee488_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
220    : device_t(mconfig, IEEE488, "IEEE488", tag, owner, clock),
221     m_stub(*(this->owner()), IEEE488_STUB_TAG)
337    : device_t(mconfig, IEEE488, "IEEE488 bus", tag, owner, clock),
338     m_dio(0xff)
222339{
340   for (int i = 0; i < SIGNAL_COUNT; i++)
341   {
342      m_line[i] = 1;
343   }
223344}
224345
225346
r13219r13220
229350
230351void ieee488_device::device_start()
231352{
232   const ieee488_config *daisy = m_daisy;
353   // resolve callbacks
354    m_out_eoi_func.resolve(m_out_eoi_cb, *this);
355    m_out_dav_func.resolve(m_out_dav_cb, *this);
356    m_out_nrfd_func.resolve(m_out_nrfd_cb, *this);
357    m_out_ndac_func.resolve(m_out_ndac_cb, *this);
358    m_out_ifc_func.resolve(m_out_ifc_cb, *this);
359    m_out_srq_func.resolve(m_out_srq_cb, *this);
360    m_out_atn_func.resolve(m_out_atn_cb, *this);
361    m_out_ren_func.resolve(m_out_ren_cb, *this);
362}
233363
234   // create a linked list of devices
235   daisy_entry **tailptr = &m_daisy_list;
236   for ( ; daisy->m_tag != NULL; daisy++)
237   {
238      // find the device
239      device_t *target = machine().device(daisy->m_tag);
240      if (target == NULL)
241         fatalerror("Unable to locate device '%s'", daisy->m_tag);
242364
243      // make sure it has an interface
244      device_ieee488_interface *intf;
245      if (!target->interface(intf))
246         fatalerror("Device '%s' does not implement the CBM IEC interface!", daisy->m_tag);
365//-------------------------------------------------
366//  add_device -
367//-------------------------------------------------
247368
248      // append to the end
249      *tailptr = auto_alloc(machine(), daisy_entry(target));
250      tailptr = &(*tailptr)->m_next;
251   }
252
253   // append driver stub to the end
254   device_t *target = machine().device(IEEE488_STUB_TAG);
255   *tailptr = auto_alloc(machine(), daisy_entry(target));
256   tailptr = &(*tailptr)->m_next;
369void ieee488_device::add_device(device_t *target)
370{
371   daisy_entry *entry = auto_alloc(machine(), daisy_entry(target));
372   m_device_list.append(*entry);
257373}
258374
259375
r13219r13220
382498
383499void ieee488_device::dio_w(UINT8 data)
384500{
385   return set_data(m_stub, data);
501   return set_data(this, data);
386502}
387503
388504
r13219r13220
392508
393509WRITE8_MEMBER( ieee488_device::dio_w )
394510{
395   return set_data(m_stub, data);
511   return set_data(this, data);
396512}
397513
398514
r13219r13220
402518
403519WRITE_LINE_MEMBER( ieee488_device::eoi_w )
404520{
405   set_signal(m_stub, EOI, state);
521   set_signal(this, EOI, state);
406522}
407523
408524
r13219r13220
412528
413529WRITE_LINE_MEMBER( ieee488_device::dav_w )
414530{
415   set_signal(m_stub, DAV, state);
531   set_signal(this, DAV, state);
416532}
417533
418534
r13219r13220
422538
423539WRITE_LINE_MEMBER( ieee488_device::nrfd_w )
424540{
425   set_signal(m_stub, NRFD, state);
541   set_signal(this, NRFD, state);
426542}
427543
428544
r13219r13220
432548
433549WRITE_LINE_MEMBER( ieee488_device::ndac_w )
434550{
435   set_signal(m_stub, NDAC, state);
551   set_signal(this, NDAC, state);
436552}
437553
438554
r13219r13220
442558
443559WRITE_LINE_MEMBER( ieee488_device::ifc_w )
444560{
445   set_signal(m_stub, IFC, state);
561   set_signal(this, IFC, state);
446562}
447563
448564
r13219r13220
452568
453569WRITE_LINE_MEMBER( ieee488_device::srq_w )
454570{
455   set_signal(m_stub, SRQ, state);
571   set_signal(this, SRQ, state);
456572}
457573
458574
r13219r13220
462578
463579WRITE_LINE_MEMBER( ieee488_device::atn_w )
464580{
465   set_signal(m_stub, ATN, state);
581   set_signal(this, ATN, state);
466582}
467583
468584
r13219r13220
472588
473589WRITE_LINE_MEMBER( ieee488_device::ren_w )
474590{
475   set_signal(m_stub, REN, state);
591   set_signal(this, REN, state);
476592}
477593
478594
src/mess/machine/ieee488.h
r13219r13220
2222//**************************************************************************
2323
2424#define IEEE488_TAG         "ieee_bus"
25#define IEEE488_STUB_TAG   "ieee_stub"
2625
2726
2827
r13219r13220
3029//  INTERFACE CONFIGURATION MACROS
3130//**************************************************************************
3231
33#define MCFG_IEEE488_ADD(_daisy) \
34    MCFG_DEVICE_ADD(IEEE488_STUB_TAG, IEEE488_STUB, 0) \
35   MCFG_DEVICE_CONFIG(default_ieee488_stub_interface) \
36   MCFG_DEVICE_ADD(IEEE488_TAG, IEEE488, 0) \
37   MCFG_DEVICE_CONFIG(_daisy)
32#define MCFG_IEEE488_BUS_ADD(_config) \
33    MCFG_DEVICE_ADD(IEEE488_TAG, IEEE488, 0) \
34    MCFG_DEVICE_CONFIG(_config)
3835
3936
40#define MCFG_IEEE488_CONFIG_ADD(_daisy, _config) \
41    MCFG_DEVICE_ADD(IEEE488_STUB_TAG, IEEE488_STUB, 0) \
42   MCFG_DEVICE_CONFIG(_config) \
43   MCFG_DEVICE_ADD(IEEE488_TAG, IEEE488, 0) \
44   MCFG_DEVICE_CONFIG(_daisy)
37#define IEEE488_INTERFACE(_name) \
38   const ieee488_interface (_name) =
4539
4640
47#define MCFG_IEEE488_REMOVE() \
48   MCFG_DEVICE_REMOVE(IEEE488_STUB_TAG) \
49   MCFG_DEVICE_REMOVE(IEEE488_TAG)
41#define MCFG_IEEE488_SLOT_ADD(_tag, _num, _slot_intf, _def_slot, _def_inp) \
42    MCFG_DEVICE_ADD(_tag, IEEE488_SLOT, 0) \
43   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp) \
44   ieee488_slot_device::static_set_slot(*device, _num);
5045
5146
52#define IEEE488_DAISY(_name) \
53   const ieee488_config (_name)[] =
5447
55
56#define IEEE488_INTERFACE(_name) \
57   const ieee488_stub_interface (_name) =
58
59
60
6148//**************************************************************************
6249//  TYPE DEFINITIONS
6350//**************************************************************************
6451
65// ======================> ieee488_config
52// ======================> ieee488_interface
6653
67struct ieee488_config
54struct ieee488_interface
6855{
69   const char *m_tag;
56   devcb_write_line   m_out_eoi_cb;
57   devcb_write_line   m_out_dav_cb;
58   devcb_write_line   m_out_nrfd_cb;
59   devcb_write_line   m_out_ndac_cb;
60   devcb_write_line   m_out_ifc_cb;
61   devcb_write_line   m_out_srq_cb;
62   devcb_write_line   m_out_atn_cb;
63   devcb_write_line   m_out_ren_cb;
7064};
7165
72// ======================> device_ieee488_interface
7366
74class device_ieee488_interface : public device_interface
75{
76public:
77   // construction/destruction
78   device_ieee488_interface(const machine_config &mconfig, device_t &device);
79   virtual ~device_ieee488_interface();
80
81   // optional operation overrides
82   virtual void ieee488_eoi(int state) { };
83   virtual void ieee488_dav(int state) { };
84   virtual void ieee488_nrfd(int state) { };
85   virtual void ieee488_ndac(int state) { };
86   virtual void ieee488_ifc(int state) { };
87   virtual void ieee488_srq(int state) { };
88   virtual void ieee488_atn(int state) { };
89   virtual void ieee488_ren(int state) { };
90};
91
9267// ======================> ieee488_device
9368
94class ieee488_stub_device;
69class device_ieee488_interface;
9570
96class ieee488_device :  public device_t,
97                  public ieee488_config
71class ieee488_device : public device_t,
72                  public ieee488_interface
9873{
99
10074public:
101    // construction/destruction
102    ieee488_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
75   // construction/destruction
76   ieee488_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
10377
78   void add_device(device_t *target);
79   
10480   // reads for both host and peripherals
10581   UINT8 dio_r();
10682   READ8_MEMBER( dio_r );
r13219r13220
135111   void srq_w(device_t *device, int state);
136112   void atn_w(device_t *device, int state);
137113   void ren_w(device_t *device, int state);
138
114   
139115protected:
140116   enum
141117   {
r13219r13220
149125      REN,
150126      SIGNAL_COUNT
151127   };
152
128   
153129   // device-level overrides
154130    virtual void device_start();
155131    virtual void device_config_complete();
156
132   
157133   class daisy_entry
158134   {
159135   public:
160136      daisy_entry(device_t *device);
137      daisy_entry *next() const { return m_next; }
161138
162139      daisy_entry *            m_next;         // next device
163140      device_t *               m_device;      // associated device
r13219r13220
167144      UINT8 m_dio;
168145   };
169146
170   daisy_entry *         m_daisy_list;   // head of the daisy chain
171
147   simple_list<daisy_entry> m_device_list;
148   
172149private:
150   devcb_resolved_write_line   m_out_eoi_func;
151   devcb_resolved_write_line   m_out_dav_func;
152   devcb_resolved_write_line   m_out_nrfd_func;
153   devcb_resolved_write_line   m_out_ndac_func;
154   devcb_resolved_write_line   m_out_ifc_func;
155   devcb_resolved_write_line   m_out_srq_func;
156   devcb_resolved_write_line   m_out_atn_func;
157   devcb_resolved_write_line   m_out_ren_func;
158   
173159   inline void set_signal(device_t *device, int signal, int state);
174160   inline int get_signal(int signal);
175161   inline void set_data(device_t *device, UINT8 data);
176162   inline UINT8 get_data();
177163
178   required_device<ieee488_stub_device> m_stub;
179
180   const ieee488_config *m_daisy;
164   int m_line[SIGNAL_COUNT];
165   UINT8 m_dio;
181166};
182167
183168
184// ======================> ieee488_stub_interface
169// ======================> ieee488_slot_device
185170
186struct ieee488_stub_interface
171class ieee488_slot_device : public device_t,
172                     public device_slot_interface
187173{
188   devcb_write_line   m_out_eoi_cb;
189   devcb_write_line   m_out_dav_cb;
190   devcb_write_line   m_out_nrfd_cb;
191   devcb_write_line   m_out_ndac_cb;
192   devcb_write_line   m_out_ifc_cb;
193   devcb_write_line   m_out_srq_cb;
194   devcb_write_line   m_out_atn_cb;
195   devcb_write_line   m_out_ren_cb;
196};
174public:
175   // construction/destruction
176   ieee488_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
197177
198const ieee488_stub_interface default_ieee488_stub_interface = { DEVCB_NULL, };
178   // device-level overrides
179   virtual void device_start();
199180
181    // inline configuration
182    static void static_set_slot(device_t &device, int address);
183   int get_address();
200184
201// ======================> ieee488_stub_device
185private:
186   // configuration
187   int m_address;
188   ieee488_device  *m_bus;
189};
202190
203class ieee488_stub_device :  public device_t,
204                      public ieee488_stub_interface,
205                      public device_ieee488_interface
191
192// ======================> device_ieee488_interface
193
194class device_ieee488_interface : public device_slot_card_interface
206195{
196   friend class ieee488_device;
197
207198public:
208199   // construction/destruction
209    ieee488_stub_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
200   device_ieee488_interface(const machine_config &mconfig, device_t &device);
201   virtual ~device_ieee488_interface();
210202
211protected:
212    // device-level overrides
213    virtual void device_start();
214    virtual void device_config_complete();
215
216   // device_ieee488_interface overrides
217   void ieee488_eoi(int state);
218   void ieee488_dav(int state);
219   void ieee488_nrfd(int state);
220   void ieee488_ndac(int state);
221   void ieee488_ifc(int state);
222   void ieee488_srq(int state);
223   void ieee488_atn(int state);
224   void ieee488_ren(int state);
225
226private:
227   devcb_resolved_write_line   m_out_eoi_func;
228   devcb_resolved_write_line   m_out_dav_func;
229   devcb_resolved_write_line   m_out_nrfd_func;
230   devcb_resolved_write_line   m_out_ndac_func;
231   devcb_resolved_write_line   m_out_ifc_func;
232   devcb_resolved_write_line   m_out_srq_func;
233   devcb_resolved_write_line   m_out_atn_func;
234   devcb_resolved_write_line   m_out_ren_func;
203   device_ieee488_interface *next() const { return m_next; }
204   
205   // optional operation overrides
206   virtual void ieee488_eoi(int state) { };
207   virtual void ieee488_dav(int state) { };
208   virtual void ieee488_nrfd(int state) { };
209   virtual void ieee488_ndac(int state) { };
210   virtual void ieee488_ifc(int state) { };
211   virtual void ieee488_srq(int state) { };
212   virtual void ieee488_atn(int state) { };
213   virtual void ieee488_ren(int state) { };
214   
215   ieee488_device  *m_bus;
216   device_ieee488_interface *m_next;
235217};
236218
237219
238220// device type definition
239221extern const device_type IEEE488;
240extern const device_type IEEE488_STUB;
222extern const device_type IEEE488_SLOT;
241223
242224
225
243226#endif
src/mess/mess_dev.lst
r13219r13220
5454C1571CR
5555C1563
5656C1581
57C2040 // C3040 have same roms
57C2040
58C3040
5859C4040
5960C8050
6061C8250
6162C8280
62C9060 // C9090 has same roms
63C9060
64C9090
6365SFD1001
6466C2031
6567COCO_FDC
src/mess/mess.mak
r13219r13220
529529   $(MESS_MACHINE)/i82439tx.o   \
530530   $(MESS_MACHINE)/i8271.o      \
531531   $(MESS_MACHINE)/ieee488.o   \
532   $(MESS_MACHINE)/ieeestub.o   \
533532   $(MESS_MACHINE)/isa.o      \
534533   $(MESS_MACHINE)/kb3600.o   \
535534   $(MESS_MACHINE)/kr2376.o   \
src/mess/drivers/cbmb.c
r13219r13220
106106#include "includes/cbm.h"
107107#include "includes/cbmb.h"
108108#include "machine/ieee488.h"
109#include "machine/c2031.h"
109110#include "machine/c2040.h"
111#include "machine/c8280.h"
112#include "machine/c9060.h"
110113#include "machine/cbmipt.h"
111114#include "video/vic6567.h"
112115#include "video/mc6845.h"
r13219r13220
411414   DEVCB_NULL
412415};
413416
414static IEEE488_DAISY( ieee488_daisy )
417static SLOT_INTERFACE_START( cbm_ieee488_devices )
418   SLOT_INTERFACE("c2040", C2040)
419   SLOT_INTERFACE("c3040", C3040)
420   SLOT_INTERFACE("c4040", C4040)
421   SLOT_INTERFACE("c8050", C8050)
422   SLOT_INTERFACE("c8250", C8250)
423   SLOT_INTERFACE("sfd1001", SFD1001)
424   SLOT_INTERFACE("c2031", C2031)
425   SLOT_INTERFACE("c8280", C8280)
426   SLOT_INTERFACE("c9060", C9060)
427   SLOT_INTERFACE("c9090", C9090)
428SLOT_INTERFACE_END
429
430static IEEE488_INTERFACE( ieee488_intf )
415431{
416   { "drive" },
417   { NULL}
432   DEVCB_NULL,
433   DEVCB_NULL,
434   DEVCB_NULL,
435   DEVCB_NULL,
436   DEVCB_NULL,
437   DEVCB_NULL,
438   DEVCB_NULL,
439   DEVCB_NULL
418440};
419441
420442static MACHINE_CONFIG_START( cbm600, cbmb_state )
r13219r13220
457479   MCFG_TPI6525_ADD("tpi6525_1", cbmb_tpi_1_intf)
458480
459481   /* IEEE bus */
460   MCFG_IEEE488_ADD(ieee488_daisy)
461   MCFG_C8250_ADD("drive", 8)
482   MCFG_IEEE488_BUS_ADD(ieee488_intf)
483   MCFG_IEEE488_SLOT_ADD("ieee8", 8, cbm_ieee488_devices, "c8250", NULL)
484   MCFG_IEEE488_SLOT_ADD("ieee9", 9, cbm_ieee488_devices, NULL, NULL)
485   MCFG_IEEE488_SLOT_ADD("ieee10", 10, cbm_ieee488_devices, NULL, NULL)
486   MCFG_IEEE488_SLOT_ADD("ieee11", 11, cbm_ieee488_devices, NULL, NULL)
462487
463488   MCFG_FRAGMENT_ADD(cbmb_cartslot)
464489MACHINE_CONFIG_END
r13219r13220
533558   MCFG_TPI6525_ADD("tpi6525_1", cbmb_tpi_1_intf)
534559
535560   /* IEEE bus */
536   MCFG_IEEE488_ADD(ieee488_daisy)
537   MCFG_C8250_ADD("drive", 8)
561   MCFG_IEEE488_BUS_ADD(ieee488_intf)
562   MCFG_IEEE488_SLOT_ADD("ieee8", 8, cbm_ieee488_devices, "c8250", NULL)
563   MCFG_IEEE488_SLOT_ADD("ieee9", 9, cbm_ieee488_devices, NULL, NULL)
564   MCFG_IEEE488_SLOT_ADD("ieee10", 10, cbm_ieee488_devices, NULL, NULL)
565   MCFG_IEEE488_SLOT_ADD("ieee11", 11, cbm_ieee488_devices, NULL, NULL)
538566
539567   MCFG_FRAGMENT_ADD(cbmb_cartslot)
540568MACHINE_CONFIG_END
src/mess/drivers/vic20.c
r13219r13220
454454   DEVCB_NULL
455455};
456456
457/* IEEE-488 Bus */
458
459#ifdef INCLUDE_VIC1112
460static IEEE488_DAISY( ieee488_daisy )
461{
462   { C2031_TAG },
463   { NULL}
464};
465
466#endif
467
468457/* MOS6560 Interface */
469458
470459#define VC20ADDR2MOS6560ADDR(a) (((a) > 0x8000) ? ((a) & 0x1fff) : ((a) | 0x2000))
r13219r13220
704693   MCFG_CBM_IEC_SLOT_ADD("iec10", 10, cbm_iec_devices, NULL, NULL)
705694   MCFG_CBM_IEC_SLOT_ADD("iec11", 11, cbm_iec_devices, NULL, NULL)
706695#ifdef INCLUDE_VIC1112
707    MCFG_VIC1112_ADD(ieee488_daisy)
708    MCFG_C2031_ADD(C2031_TAG, 9)
696    MCFG_VIC1112_ADD()
709697#endif
710698   MCFG_CARTSLOT_ADD("cart")
711699   MCFG_CARTSLOT_EXTENSION_LIST("20,40,60,70,a0,b0")
src/mess/drivers/pet.c
r13219r13220
388388#include "machine/cbmipt.h"
389389#include "video/mc6845.h"
390390#include "machine/ram.h"
391#include "machine/c2031.h"
391392#include "machine/c2040.h"
392393#include "machine/c8280.h"
393394#include "machine/c9060.h"
r13219r13220
646647   return 0;
647648}
648649
649static IEEE488_DAISY( ieee488_daisy )
650{
651   { "drive" },
652   { NULL}
653};
650static SLOT_INTERFACE_START( cbm_ieee488_devices )
651   SLOT_INTERFACE("c2040", C2040)
652   SLOT_INTERFACE("c3040", C3040)
653   SLOT_INTERFACE("c4040", C4040)
654   SLOT_INTERFACE("c8050", C8050)
655   SLOT_INTERFACE("c8250", C8250)
656   SLOT_INTERFACE("sfd1001", SFD1001)
657   SLOT_INTERFACE("c2031", C2031)
658   SLOT_INTERFACE("c8280", C8280)
659   SLOT_INTERFACE("c9060", C9060)
660   SLOT_INTERFACE("c9090", C9090)
661SLOT_INTERFACE_END
654662
655663static IEEE488_INTERFACE( ieee488_intf )
656664{
r13219r13220
715723   MCFG_RAM_EXTRA_OPTIONS("8K,16K")
716724
717725   /* IEEE bus */
718   MCFG_IEEE488_CONFIG_ADD(ieee488_daisy, ieee488_intf)
719   MCFG_C4040_ADD("drive", 8)
726   MCFG_IEEE488_BUS_ADD(ieee488_intf)
727   MCFG_IEEE488_SLOT_ADD("ieee8", 8, cbm_ieee488_devices, "c4040", NULL)
728   MCFG_IEEE488_SLOT_ADD("ieee9", 9, cbm_ieee488_devices, NULL, NULL)
729   MCFG_IEEE488_SLOT_ADD("ieee10", 10, cbm_ieee488_devices, NULL, NULL)
730   MCFG_IEEE488_SLOT_ADD("ieee11", 11, cbm_ieee488_devices, NULL, NULL)
720731MACHINE_CONFIG_END
721732
722733
r13219r13220
734745   MCFG_RAM_EXTRA_OPTIONS("4K")
735746
736747   /* IEEE bus */
737   MCFG_IEEE488_CONFIG_ADD(ieee488_daisy, ieee488_intf)
738   MCFG_C4040_ADD("drive", 8)
748   MCFG_IEEE488_BUS_ADD(ieee488_intf)
749   MCFG_IEEE488_SLOT_ADD("ieee8", 8, cbm_ieee488_devices, "c4040", NULL)
750   MCFG_IEEE488_SLOT_ADD("ieee9", 9, cbm_ieee488_devices, NULL, NULL)
751   MCFG_IEEE488_SLOT_ADD("ieee10", 10, cbm_ieee488_devices, NULL, NULL)
752   MCFG_IEEE488_SLOT_ADD("ieee11", 11, cbm_ieee488_devices, NULL, NULL)
739753MACHINE_CONFIG_END
740754
741755
r13219r13220
788802   MCFG_RAM_DEFAULT_SIZE("32K")
789803
790804   /* IEEE bus */
791   MCFG_IEEE488_CONFIG_ADD(ieee488_daisy, ieee488_intf)
792   MCFG_C8050_ADD("drive", 8)
805   MCFG_IEEE488_BUS_ADD(ieee488_intf)
806   MCFG_IEEE488_SLOT_ADD("ieee8", 8, cbm_ieee488_devices, "c8050", NULL)
807   MCFG_IEEE488_SLOT_ADD("ieee9", 9, cbm_ieee488_devices, NULL, NULL)
808   MCFG_IEEE488_SLOT_ADD("ieee10", 10, cbm_ieee488_devices, NULL, NULL)
809   MCFG_IEEE488_SLOT_ADD("ieee11", 11, cbm_ieee488_devices, NULL, NULL)
793810MACHINE_CONFIG_END
794811
795812
src/mess/drivers/victor9k.c
r13219r13220
881881
882882/* IEEE-488 Interface */
883883
884static IEEE488_DAISY( ieee488_daisy )
885{
886   { NULL }
887};
888
889884static IEEE488_INTERFACE( ieee488_intf )
890885{
891886   DEVCB_NULL,
r13219r13220
953948   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
954949
955950   /* devices */
956   MCFG_IEEE488_CONFIG_ADD(ieee488_daisy, ieee488_intf)
951   MCFG_IEEE488_BUS_ADD(ieee488_intf)
957952   MCFG_PIC8259_ADD(I8259A_TAG, pic_intf)
958953   MCFG_PIT8253_ADD(I8253_TAG, pit_intf)
959954   MCFG_UPD7201_ADD(UPD7201_TAG, XTAL_30MHz/30, mpsc_intf)
src/mess/drivers/tek405x.c
r13219r13220
11431143};
11441144
11451145
1146
11461147//-------------------------------------------------
1147//  IEEE488_DAISY( ieee488_daisy )
1148//  IEEE488_INTERFACE( ieee488_intf )
11481149//-------------------------------------------------
11491150
1150static IEEE488_DAISY( ieee488_daisy )
1151static IEEE488_INTERFACE( ieee488_intf )
11511152{
1152   { NULL}
1153   DEVCB_NULL,
1154   DEVCB_NULL,
1155   DEVCB_NULL,
1156   DEVCB_NULL,
1157   DEVCB_NULL,
1158   DEVCB_NULL,
1159   DEVCB_NULL,
1160   DEVCB_NULL
11531161};
11541162
11551163
r13219r13220
12361244   MCFG_PIA6821_ADD(MC6820_GPIB_TAG, gpib_pia_intf)
12371245   MCFG_PIA6821_ADD(MC6820_COM_TAG, com_pia_intf)
12381246   MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf)
1239   MCFG_IEEE488_ADD(ieee488_daisy)
1247   MCFG_IEEE488_BUS_ADD(ieee488_intf)
12401248   //MCFG_RS232_ADD(RS232_TAG, rs232_intf)
12411249
12421250   // internal ram
src/mess/drivers/vixen.c
r13219r13220
696696
697697
698698//-------------------------------------------------
699//  IEEE488_DAISY( ieee488_daisy )
699//  IEEE488_INTERFACE( ieee488_intf )
700700//-------------------------------------------------
701701
702702WRITE_LINE_MEMBER( vixen_state::srq_w )
r13219r13220
711711   update_interrupt();
712712}
713713
714static IEEE488_DAISY( ieee488_daisy )
715{
716   { NULL }
717};
718
719714static IEEE488_INTERFACE( ieee488_intf )
720715{
721716   DEVCB_NULL,
r13219r13220
869864   MCFG_I8251_ADD(P8251A_TAG, usart_intf)
870865   MCFG_FD1797_ADD(FDC1797_TAG, fdc_intf)
871866   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(vixen_floppy_interface)
872   MCFG_IEEE488_CONFIG_ADD(ieee488_daisy, ieee488_intf)
867   MCFG_IEEE488_BUS_ADD(ieee488_intf)
873868
874869   /* software lists */
875870   MCFG_SOFTWARE_LIST_ADD("disk_list","vixen")

Previous 15994 Revisions Next


© 1998-2018 The MESS Team