src/mess/machine/ieeestub.c
| r13219 | r13220 | |
| 1 | | #include "ieee488.h" |
| 2 | | |
| 3 | | const 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 | | |
| 11 | | void 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 | | |
| 41 | | ieee488_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 | | |
| 52 | | void 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 | | |
| 70 | | void ieee488_stub_device::ieee488_eoi(int state) |
| 71 | | { |
| 72 | | m_out_eoi_func(state); |
| 73 | | } |
| 74 | | |
| 75 | | |
| 76 | | //------------------------------------------------- |
| 77 | | // ieee488_dav - |
| 78 | | //------------------------------------------------- |
| 79 | | |
| 80 | | void ieee488_stub_device::ieee488_dav(int state) |
| 81 | | { |
| 82 | | m_out_dav_func(state); |
| 83 | | } |
| 84 | | |
| 85 | | |
| 86 | | //------------------------------------------------- |
| 87 | | // ieee488_nrfd - |
| 88 | | //------------------------------------------------- |
| 89 | | |
| 90 | | void ieee488_stub_device::ieee488_nrfd(int state) |
| 91 | | { |
| 92 | | m_out_nrfd_func(state); |
| 93 | | } |
| 94 | | |
| 95 | | |
| 96 | | //------------------------------------------------- |
| 97 | | // ieee488_ndac - |
| 98 | | //------------------------------------------------- |
| 99 | | |
| 100 | | void ieee488_stub_device::ieee488_ndac(int state) |
| 101 | | { |
| 102 | | m_out_ndac_func(state); |
| 103 | | } |
| 104 | | |
| 105 | | |
| 106 | | //------------------------------------------------- |
| 107 | | // ieee488_ifc - |
| 108 | | //------------------------------------------------- |
| 109 | | |
| 110 | | void ieee488_stub_device::ieee488_ifc(int state) |
| 111 | | { |
| 112 | | m_out_ifc_func(state); |
| 113 | | } |
| 114 | | |
| 115 | | |
| 116 | | //------------------------------------------------- |
| 117 | | // ieee488_srq - |
| 118 | | //------------------------------------------------- |
| 119 | | |
| 120 | | void ieee488_stub_device::ieee488_srq(int state) |
| 121 | | { |
| 122 | | m_out_srq_func(state); |
| 123 | | } |
| 124 | | |
| 125 | | |
| 126 | | //------------------------------------------------- |
| 127 | | // ieee488_atn - |
| 128 | | //------------------------------------------------- |
| 129 | | |
| 130 | | void ieee488_stub_device::ieee488_atn(int state) |
| 131 | | { |
| 132 | | m_out_atn_func(state); |
| 133 | | } |
| 134 | | |
| 135 | | |
| 136 | | //------------------------------------------------- |
| 137 | | // ieee488_ren - |
| 138 | | //------------------------------------------------- |
| 139 | | |
| 140 | | void ieee488_stub_device::ieee488_ren(int state) |
| 141 | | { |
| 142 | | m_out_ren_func(state); |
| 143 | | } |
src/mess/machine/vic1112.c
| r13219 | r13220 | |
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | //------------------------------------------------- |
| 42 | | // IEEE488_INTERFACE( vic1112_ieee488_intf ) |
| 42 | // IEEE488_INTERFACE( ieee488_intf ) |
| 43 | 43 | //------------------------------------------------- |
| 44 | 44 | |
| 45 | | IEEE488_INTERFACE( vic1112_ieee488_intf ) |
| 45 | static 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) |
| 56 | SLOT_INTERFACE_END |
| 57 | |
| 58 | IEEE488_INTERFACE( ieee488_intf ) |
| 46 | 59 | { |
| 47 | 60 | DEVCB_NULL, |
| 48 | 61 | DEVCB_NULL, |
| 49 | 62 | DEVCB_NULL, |
| 50 | 63 | DEVCB_NULL, |
| 51 | 64 | 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), |
| 53 | 66 | DEVCB_NULL, |
| 54 | 67 | DEVCB_NULL |
| 55 | 68 | }; |
| r13219 | r13220 | |
| 274 | 287 | static MACHINE_CONFIG_FRAGMENT( vic1112 ) |
| 275 | 288 | MCFG_VIA6522_ADD(M6522_0_TAG, 0, via0_intf) |
| 276 | 289 | 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) |
| 277 | 296 | MACHINE_CONFIG_END |
| 278 | 297 | |
| 279 | 298 | |
| r13219 | r13220 | |
| 301 | 320 | : device_t(mconfig, VIC1112, "VIC1112", tag, owner, clock), |
| 302 | 321 | m_via0(*this, M6522_0_TAG), |
| 303 | 322 | m_via1(*this, M6522_1_TAG), |
| 304 | | m_bus(*this->owner(), IEEE488_TAG) |
| 323 | m_bus(*this, IEEE488_TAG) |
| 305 | 324 | { |
| 306 | 325 | } |
| 307 | 326 | |
src/mess/machine/c2040.c
| r13219 | r13220 | |
| 10 | 10 | /* |
| 11 | 11 | |
| 12 | 12 | TODO: |
| 13 | |
| 14 | - 8050/8250 only work when debugger is active!? |
| 13 | 15 | |
| 14 | 16 | - 2040 DOS 1 FDC rom (jumps to 104d while getting block header) |
| 15 | 17 | |
| r13219 | r13220 | |
| 110 | 112 | |
| 111 | 113 | |
| 112 | 114 | //------------------------------------------------- |
| 113 | | // static_set_config - configuration helper |
| 114 | | //------------------------------------------------- |
| 115 | | |
| 116 | | void 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 | | //------------------------------------------------- |
| 127 | 115 | // ROM( c2040 ) |
| 128 | 116 | //------------------------------------------------- |
| 129 | 117 | |
| r13219 | r13220 | |
| 268 | 256 | AM_RANGE(0x2000, 0x23ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share2") |
| 269 | 257 | AM_RANGE(0x3000, 0x33ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share3") |
| 270 | 258 | 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) |
| 272 | 260 | ADDRESS_MAP_END |
| 273 | 261 | |
| 274 | 262 | |
| r13219 | r13220 | |
| 285 | 273 | AM_RANGE(0x0800, 0x0bff) AM_RAM AM_SHARE("share2") |
| 286 | 274 | AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_SHARE("share3") |
| 287 | 275 | 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) |
| 289 | 277 | ADDRESS_MAP_END |
| 290 | 278 | |
| 291 | 279 | |
| r13219 | r13220 | |
| 302 | 290 | AM_RANGE(0x2000, 0x23ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share2") |
| 303 | 291 | AM_RANGE(0x3000, 0x33ff) AM_MIRROR(0x0c00) AM_RAM AM_SHARE("share3") |
| 304 | 292 | 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) |
| 306 | 294 | ADDRESS_MAP_END |
| 307 | 295 | |
| 308 | 296 | |
| r13219 | r13220 | |
| 319 | 307 | AM_RANGE(0x0800, 0x0bff) AM_RAM AM_SHARE("share2") |
| 320 | 308 | AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_SHARE("share3") |
| 321 | 309 | 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) |
| 323 | 311 | ADDRESS_MAP_END |
| 324 | 312 | |
| 325 | 313 | |
| r13219 | r13220 | |
| 336 | 324 | AM_RANGE(0x0800, 0x0bff) AM_RAM AM_SHARE("share2") |
| 337 | 325 | AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_SHARE("share3") |
| 338 | 326 | 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) |
| 340 | 328 | ADDRESS_MAP_END |
| 341 | 329 | |
| 342 | 330 | |
| r13219 | r13220 | |
| 1465 | 1453 | m_via(*this, M6522_TAG), |
| 1466 | 1454 | m_image0(*this, FLOPPY_0), |
| 1467 | 1455 | m_image1(*this, FLOPPY_1), |
| 1468 | | m_bus(*this->owner(), IEEE488_TAG), |
| 1469 | 1456 | m_drive(0), |
| 1470 | 1457 | m_side(0), |
| 1471 | 1458 | m_rfdo(1), |
| r13219 | r13220 | |
| 1544 | 1531 | |
| 1545 | 1532 | void base_c2040_device::device_start() |
| 1546 | 1533 | { |
| 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); |
| 1549 | 1535 | |
| 1536 | // get bus address |
| 1537 | ieee488_slot_device *slot = downcast<ieee488_slot_device*>(owner()); |
| 1538 | m_address = slot->get_address() - 8; |
| 1539 | |
| 1550 | 1540 | m_bit_timer = timer_alloc(); |
| 1551 | 1541 | |
| 1552 | 1542 | switch (m_variant) |
| 1553 | 1543 | { |
| 1554 | 1544 | default: |
| 1555 | | main->install_rom(0x5000, 0x7fff, subregion(M6502_TAG)->base()); |
| 1556 | | fdc->install_rom(0x1c00, 0x1fff, subregion(M6504_TAG)->base()); |
| 1557 | | |
| 1558 | 1545 | initialize(2); |
| 1559 | 1546 | break; |
| 1560 | 1547 | |
| 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 | | |
| 1569 | 1548 | 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 | | |
| 1573 | 1549 | initialize(1); |
| 1574 | 1550 | break; |
| 1575 | 1551 | } |
src/mess/machine/c2040.h
| r13219 | r13220 | |
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | //************************************************************************** |
| 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 | | //************************************************************************** |
| 78 | 30 | // TYPE DEFINITIONS |
| 79 | 31 | //************************************************************************** |
| 80 | 32 | |
| r13219 | r13220 | |
| 122 | 74 | DECLARE_READ8_MEMBER( c8050_miot_pb_r ); |
| 123 | 75 | DECLARE_WRITE8_MEMBER( c8050_miot_pb_w ); |
| 124 | 76 | |
| 125 | | // inline configuration helpers |
| 126 | | static void static_set_config(device_t &device, int address); |
| 127 | | |
| 128 | 77 | // optional information overrides |
| 129 | 78 | virtual const rom_entry *device_rom_region() const; |
| 130 | 79 | virtual machine_config_constructor device_mconfig_additions() const; |
| r13219 | r13220 | |
| 156 | 105 | required_device<via6522_device> m_via; |
| 157 | 106 | required_device<device_t> m_image0; |
| 158 | 107 | optional_device<device_t> m_image1; |
| 159 | | required_device<ieee488_device> m_bus; |
| 108 | ieee488_device *m_bus; |
| 160 | 109 | |
| 161 | 110 | struct { |
| 162 | 111 | // motors |
src/mess/machine/ieee488.c
| r13219 | r13220 | |
| 9 | 9 | **********************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "ieee488.h" |
| 12 | | #include "machine/devhelpr.h" |
| 13 | 12 | |
| 14 | 13 | |
| 15 | 14 | |
| r13219 | r13220 | |
| 29 | 28 | //************************************************************************** |
| 30 | 29 | |
| 31 | 30 | const device_type IEEE488 = &device_creator<ieee488_device>; |
| 31 | const device_type IEEE488_SLOT = &device_creator<ieee488_slot_device>; |
| 32 | 32 | |
| 33 | 33 | |
| 34 | |
| 34 | 35 | //************************************************************************** |
| 35 | 36 | // DEVICE INTERFACE |
| 36 | 37 | //************************************************************************** |
| r13219 | r13220 | |
| 40 | 41 | //------------------------------------------------- |
| 41 | 42 | |
| 42 | 43 | device_ieee488_interface::device_ieee488_interface(const machine_config &mconfig, device_t &device) |
| 43 | | : device_interface(device) |
| 44 | : device_slot_card_interface(mconfig, device) |
| 44 | 45 | { |
| 45 | 46 | } |
| 46 | 47 | |
| r13219 | r13220 | |
| 53 | 54 | { |
| 54 | 55 | } |
| 55 | 56 | |
| 57 | |
| 58 | |
| 59 | //************************************************************************** |
| 60 | // LIVE DEVICE |
| 61 | //************************************************************************** |
| 62 | |
| 56 | 63 | //------------------------------------------------- |
| 64 | // ieee488_slot_device - constructor |
| 65 | //------------------------------------------------- |
| 66 | |
| 67 | ieee488_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 | |
| 78 | void 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 | |
| 89 | int ieee488_slot_device::get_address() |
| 90 | { |
| 91 | return m_address; |
| 92 | } |
| 93 | |
| 94 | |
| 95 | //------------------------------------------------- |
| 96 | // device_start - device-specific startup |
| 97 | //------------------------------------------------- |
| 98 | |
| 99 | void 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 | //------------------------------------------------- |
| 57 | 113 | // device_config_complete - perform any |
| 58 | 114 | // operations now that the configuration is |
| 59 | 115 | // complete |
| r13219 | r13220 | |
| 62 | 118 | void ieee488_device::device_config_complete() |
| 63 | 119 | { |
| 64 | 120 | // 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()); |
| 66 | 122 | if (intf != NULL) |
| 67 | | *static_cast<ieee488_config *>(this) = *intf; |
| 123 | *static_cast<ieee488_interface *>(this) = *intf; |
| 68 | 124 | |
| 69 | 125 | // or initialize to defaults if none provided |
| 70 | 126 | else |
| 71 | 127 | { |
| 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)); |
| 73 | 136 | } |
| 74 | | |
| 75 | | m_daisy = intf; |
| 76 | 137 | } |
| 77 | 138 | |
| 78 | 139 | |
| r13219 | r13220 | |
| 89 | 150 | { |
| 90 | 151 | bool changed = false; |
| 91 | 152 | |
| 92 | | for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next) |
| 153 | if (device == this) |
| 93 | 154 | { |
| 94 | | if (!strcmp(daisy->m_device->tag(), device->tag())) |
| 155 | if (m_line[signal] != state) |
| 95 | 156 | { |
| 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())) |
| 97 | 169 | { |
| 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 | } |
| 101 | 176 | } |
| 177 | |
| 178 | entry = entry->next(); |
| 102 | 179 | } |
| 103 | 180 | } |
| 104 | 181 | |
| 105 | 182 | if (changed) |
| 106 | 183 | { |
| 107 | | for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next) |
| 184 | switch (signal) |
| 108 | 185 | { |
| 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 | { |
| 109 | 200 | switch (signal) |
| 110 | 201 | { |
| 111 | 202 | case EOI: |
| 112 | | daisy->m_interface->ieee488_eoi(state); |
| 203 | entry->m_interface->ieee488_eoi(state); |
| 113 | 204 | break; |
| 114 | 205 | |
| 115 | 206 | case DAV: |
| 116 | | daisy->m_interface->ieee488_dav(state); |
| 207 | entry->m_interface->ieee488_dav(state); |
| 117 | 208 | break; |
| 118 | 209 | |
| 119 | 210 | case NRFD: |
| 120 | | daisy->m_interface->ieee488_nrfd(state); |
| 211 | entry->m_interface->ieee488_nrfd(state); |
| 121 | 212 | break; |
| 122 | 213 | |
| 123 | 214 | case NDAC: |
| 124 | | daisy->m_interface->ieee488_ndac(state); |
| 215 | entry->m_interface->ieee488_ndac(state); |
| 125 | 216 | break; |
| 126 | 217 | |
| 127 | 218 | case IFC: |
| 128 | | daisy->m_interface->ieee488_ifc(state); |
| 219 | entry->m_interface->ieee488_ifc(state); |
| 129 | 220 | break; |
| 130 | 221 | |
| 131 | 222 | case SRQ: |
| 132 | | daisy->m_interface->ieee488_srq(state); |
| 223 | entry->m_interface->ieee488_srq(state); |
| 133 | 224 | break; |
| 134 | 225 | |
| 135 | 226 | case ATN: |
| 136 | | daisy->m_interface->ieee488_atn(state); |
| 227 | entry->m_interface->ieee488_atn(state); |
| 137 | 228 | break; |
| 138 | 229 | |
| 139 | 230 | case REN: |
| 140 | | daisy->m_interface->ieee488_ren(state); |
| 231 | entry->m_interface->ieee488_ren(state); |
| 141 | 232 | break; |
| 142 | 233 | } |
| 234 | |
| 235 | entry = entry->next(); |
| 143 | 236 | } |
| 144 | 237 | |
| 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", |
| 146 | 239 | get_signal(EOI), get_signal(DAV), get_signal(NRFD), get_signal(NDAC), |
| 147 | 240 | get_signal(IFC), get_signal(SRQ), get_signal(ATN), get_signal(REN), get_data()); |
| 148 | 241 | } |
| r13219 | r13220 | |
| 155 | 248 | |
| 156 | 249 | inline int ieee488_device::get_signal(int signal) |
| 157 | 250 | { |
| 158 | | int state = 1; |
| 251 | int state = m_line[signal]; |
| 159 | 252 | |
| 160 | | for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next) |
| 253 | if (state) |
| 161 | 254 | { |
| 162 | | if (!daisy->m_line[signal]) |
| 255 | daisy_entry *entry = m_device_list.first(); |
| 256 | |
| 257 | while (entry) |
| 163 | 258 | { |
| 164 | | state = 0; |
| 165 | | break; |
| 259 | if (!entry->m_line[signal]) |
| 260 | { |
| 261 | state = 0; |
| 262 | break; |
| 263 | } |
| 264 | |
| 265 | entry = entry->next(); |
| 166 | 266 | } |
| 167 | 267 | } |
| 168 | | |
| 268 | |
| 169 | 269 | return state; |
| 170 | 270 | } |
| 171 | 271 | |
| r13219 | r13220 | |
| 176 | 276 | |
| 177 | 277 | inline void ieee488_device::set_data(device_t *device, UINT8 data) |
| 178 | 278 | { |
| 179 | | for (daisy_entry *daisy = m_daisy_list; daisy != NULL; daisy = daisy->m_next) |
| 279 | if (device == this) |
| 180 | 280 | { |
| 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) |
| 182 | 290 | { |
| 183 | | if (daisy->m_dio != data) |
| 291 | if (!strcmp(entry->m_device->tag(), device->tag())) |
| 184 | 292 | { |
| 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 | } |
| 187 | 298 | } |
| 299 | |
| 300 | entry = entry->next(); |
| 188 | 301 | } |
| 189 | 302 | } |
| 190 | 303 | } |
| r13219 | r13220 | |
| 196 | 309 | |
| 197 | 310 | inline UINT8 ieee488_device::get_data() |
| 198 | 311 | { |
| 199 | | UINT8 data = 0xff; |
| 312 | UINT8 data = m_dio; |
| 200 | 313 | |
| 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) |
| 202 | 317 | { |
| 203 | | data &= daisy->m_dio; |
| 318 | data &= entry->m_dio; |
| 319 | |
| 320 | entry = entry->next(); |
| 204 | 321 | } |
| 205 | | |
| 322 | |
| 206 | 323 | return data; |
| 207 | 324 | } |
| 208 | 325 | |
| r13219 | r13220 | |
| 217 | 334 | //------------------------------------------------- |
| 218 | 335 | |
| 219 | 336 | ieee488_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) |
| 222 | 339 | { |
| 340 | for (int i = 0; i < SIGNAL_COUNT; i++) |
| 341 | { |
| 342 | m_line[i] = 1; |
| 343 | } |
| 223 | 344 | } |
| 224 | 345 | |
| 225 | 346 | |
| r13219 | r13220 | |
| 229 | 350 | |
| 230 | 351 | void ieee488_device::device_start() |
| 231 | 352 | { |
| 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 | } |
| 233 | 363 | |
| 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); |
| 242 | 364 | |
| 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 | //------------------------------------------------- |
| 247 | 368 | |
| 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; |
| 369 | void ieee488_device::add_device(device_t *target) |
| 370 | { |
| 371 | daisy_entry *entry = auto_alloc(machine(), daisy_entry(target)); |
| 372 | m_device_list.append(*entry); |
| 257 | 373 | } |
| 258 | 374 | |
| 259 | 375 | |
| r13219 | r13220 | |
| 382 | 498 | |
| 383 | 499 | void ieee488_device::dio_w(UINT8 data) |
| 384 | 500 | { |
| 385 | | return set_data(m_stub, data); |
| 501 | return set_data(this, data); |
| 386 | 502 | } |
| 387 | 503 | |
| 388 | 504 | |
| r13219 | r13220 | |
| 392 | 508 | |
| 393 | 509 | WRITE8_MEMBER( ieee488_device::dio_w ) |
| 394 | 510 | { |
| 395 | | return set_data(m_stub, data); |
| 511 | return set_data(this, data); |
| 396 | 512 | } |
| 397 | 513 | |
| 398 | 514 | |
| r13219 | r13220 | |
| 402 | 518 | |
| 403 | 519 | WRITE_LINE_MEMBER( ieee488_device::eoi_w ) |
| 404 | 520 | { |
| 405 | | set_signal(m_stub, EOI, state); |
| 521 | set_signal(this, EOI, state); |
| 406 | 522 | } |
| 407 | 523 | |
| 408 | 524 | |
| r13219 | r13220 | |
| 412 | 528 | |
| 413 | 529 | WRITE_LINE_MEMBER( ieee488_device::dav_w ) |
| 414 | 530 | { |
| 415 | | set_signal(m_stub, DAV, state); |
| 531 | set_signal(this, DAV, state); |
| 416 | 532 | } |
| 417 | 533 | |
| 418 | 534 | |
| r13219 | r13220 | |
| 422 | 538 | |
| 423 | 539 | WRITE_LINE_MEMBER( ieee488_device::nrfd_w ) |
| 424 | 540 | { |
| 425 | | set_signal(m_stub, NRFD, state); |
| 541 | set_signal(this, NRFD, state); |
| 426 | 542 | } |
| 427 | 543 | |
| 428 | 544 | |
| r13219 | r13220 | |
| 432 | 548 | |
| 433 | 549 | WRITE_LINE_MEMBER( ieee488_device::ndac_w ) |
| 434 | 550 | { |
| 435 | | set_signal(m_stub, NDAC, state); |
| 551 | set_signal(this, NDAC, state); |
| 436 | 552 | } |
| 437 | 553 | |
| 438 | 554 | |
| r13219 | r13220 | |
| 442 | 558 | |
| 443 | 559 | WRITE_LINE_MEMBER( ieee488_device::ifc_w ) |
| 444 | 560 | { |
| 445 | | set_signal(m_stub, IFC, state); |
| 561 | set_signal(this, IFC, state); |
| 446 | 562 | } |
| 447 | 563 | |
| 448 | 564 | |
| r13219 | r13220 | |
| 452 | 568 | |
| 453 | 569 | WRITE_LINE_MEMBER( ieee488_device::srq_w ) |
| 454 | 570 | { |
| 455 | | set_signal(m_stub, SRQ, state); |
| 571 | set_signal(this, SRQ, state); |
| 456 | 572 | } |
| 457 | 573 | |
| 458 | 574 | |
| r13219 | r13220 | |
| 462 | 578 | |
| 463 | 579 | WRITE_LINE_MEMBER( ieee488_device::atn_w ) |
| 464 | 580 | { |
| 465 | | set_signal(m_stub, ATN, state); |
| 581 | set_signal(this, ATN, state); |
| 466 | 582 | } |
| 467 | 583 | |
| 468 | 584 | |
| r13219 | r13220 | |
| 472 | 588 | |
| 473 | 589 | WRITE_LINE_MEMBER( ieee488_device::ren_w ) |
| 474 | 590 | { |
| 475 | | set_signal(m_stub, REN, state); |
| 591 | set_signal(this, REN, state); |
| 476 | 592 | } |
| 477 | 593 | |
| 478 | 594 | |
src/mess/machine/ieee488.h
| r13219 | r13220 | |
| 22 | 22 | //************************************************************************** |
| 23 | 23 | |
| 24 | 24 | #define IEEE488_TAG "ieee_bus" |
| 25 | | #define IEEE488_STUB_TAG "ieee_stub" |
| 26 | 25 | |
| 27 | 26 | |
| 28 | 27 | |
| r13219 | r13220 | |
| 30 | 29 | // INTERFACE CONFIGURATION MACROS |
| 31 | 30 | //************************************************************************** |
| 32 | 31 | |
| 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) |
| 38 | 35 | |
| 39 | 36 | |
| 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) = |
| 45 | 39 | |
| 46 | 40 | |
| 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); |
| 50 | 45 | |
| 51 | 46 | |
| 52 | | #define IEEE488_DAISY(_name) \ |
| 53 | | const ieee488_config (_name)[] = |
| 54 | 47 | |
| 55 | | |
| 56 | | #define IEEE488_INTERFACE(_name) \ |
| 57 | | const ieee488_stub_interface (_name) = |
| 58 | | |
| 59 | | |
| 60 | | |
| 61 | 48 | //************************************************************************** |
| 62 | 49 | // TYPE DEFINITIONS |
| 63 | 50 | //************************************************************************** |
| 64 | 51 | |
| 65 | | // ======================> ieee488_config |
| 52 | // ======================> ieee488_interface |
| 66 | 53 | |
| 67 | | struct ieee488_config |
| 54 | struct ieee488_interface |
| 68 | 55 | { |
| 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; |
| 70 | 64 | }; |
| 71 | 65 | |
| 72 | | // ======================> device_ieee488_interface |
| 73 | 66 | |
| 74 | | class device_ieee488_interface : public device_interface |
| 75 | | { |
| 76 | | public: |
| 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 | | |
| 92 | 67 | // ======================> ieee488_device |
| 93 | 68 | |
| 94 | | class ieee488_stub_device; |
| 69 | class device_ieee488_interface; |
| 95 | 70 | |
| 96 | | class ieee488_device : public device_t, |
| 97 | | public ieee488_config |
| 71 | class ieee488_device : public device_t, |
| 72 | public ieee488_interface |
| 98 | 73 | { |
| 99 | | |
| 100 | 74 | public: |
| 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); |
| 103 | 77 | |
| 78 | void add_device(device_t *target); |
| 79 | |
| 104 | 80 | // reads for both host and peripherals |
| 105 | 81 | UINT8 dio_r(); |
| 106 | 82 | READ8_MEMBER( dio_r ); |
| r13219 | r13220 | |
| 135 | 111 | void srq_w(device_t *device, int state); |
| 136 | 112 | void atn_w(device_t *device, int state); |
| 137 | 113 | void ren_w(device_t *device, int state); |
| 138 | | |
| 114 | |
| 139 | 115 | protected: |
| 140 | 116 | enum |
| 141 | 117 | { |
| r13219 | r13220 | |
| 149 | 125 | REN, |
| 150 | 126 | SIGNAL_COUNT |
| 151 | 127 | }; |
| 152 | | |
| 128 | |
| 153 | 129 | // device-level overrides |
| 154 | 130 | virtual void device_start(); |
| 155 | 131 | virtual void device_config_complete(); |
| 156 | | |
| 132 | |
| 157 | 133 | class daisy_entry |
| 158 | 134 | { |
| 159 | 135 | public: |
| 160 | 136 | daisy_entry(device_t *device); |
| 137 | daisy_entry *next() const { return m_next; } |
| 161 | 138 | |
| 162 | 139 | daisy_entry * m_next; // next device |
| 163 | 140 | device_t * m_device; // associated device |
| r13219 | r13220 | |
| 167 | 144 | UINT8 m_dio; |
| 168 | 145 | }; |
| 169 | 146 | |
| 170 | | daisy_entry * m_daisy_list; // head of the daisy chain |
| 171 | | |
| 147 | simple_list<daisy_entry> m_device_list; |
| 148 | |
| 172 | 149 | private: |
| 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 | |
| 173 | 159 | inline void set_signal(device_t *device, int signal, int state); |
| 174 | 160 | inline int get_signal(int signal); |
| 175 | 161 | inline void set_data(device_t *device, UINT8 data); |
| 176 | 162 | inline UINT8 get_data(); |
| 177 | 163 | |
| 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; |
| 181 | 166 | }; |
| 182 | 167 | |
| 183 | 168 | |
| 184 | | // ======================> ieee488_stub_interface |
| 169 | // ======================> ieee488_slot_device |
| 185 | 170 | |
| 186 | | struct ieee488_stub_interface |
| 171 | class ieee488_slot_device : public device_t, |
| 172 | public device_slot_interface |
| 187 | 173 | { |
| 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 | | }; |
| 174 | public: |
| 175 | // construction/destruction |
| 176 | ieee488_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 197 | 177 | |
| 198 | | const ieee488_stub_interface default_ieee488_stub_interface = { DEVCB_NULL, }; |
| 178 | // device-level overrides |
| 179 | virtual void device_start(); |
| 199 | 180 | |
| 181 | // inline configuration |
| 182 | static void static_set_slot(device_t &device, int address); |
| 183 | int get_address(); |
| 200 | 184 | |
| 201 | | // ======================> ieee488_stub_device |
| 185 | private: |
| 186 | // configuration |
| 187 | int m_address; |
| 188 | ieee488_device *m_bus; |
| 189 | }; |
| 202 | 190 | |
| 203 | | class ieee488_stub_device : public device_t, |
| 204 | | public ieee488_stub_interface, |
| 205 | | public device_ieee488_interface |
| 191 | |
| 192 | // ======================> device_ieee488_interface |
| 193 | |
| 194 | class device_ieee488_interface : public device_slot_card_interface |
| 206 | 195 | { |
| 196 | friend class ieee488_device; |
| 197 | |
| 207 | 198 | public: |
| 208 | 199 | // 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(); |
| 210 | 202 | |
| 211 | | protected: |
| 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 | | |
| 226 | | private: |
| 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; |
| 235 | 217 | }; |
| 236 | 218 | |
| 237 | 219 | |
| 238 | 220 | // device type definition |
| 239 | 221 | extern const device_type IEEE488; |
| 240 | | extern const device_type IEEE488_STUB; |
| 222 | extern const device_type IEEE488_SLOT; |
| 241 | 223 | |
| 242 | 224 | |
| 225 | |
| 243 | 226 | #endif |
src/mess/drivers/cbmb.c
| r13219 | r13220 | |
| 106 | 106 | #include "includes/cbm.h" |
| 107 | 107 | #include "includes/cbmb.h" |
| 108 | 108 | #include "machine/ieee488.h" |
| 109 | #include "machine/c2031.h" |
| 109 | 110 | #include "machine/c2040.h" |
| 111 | #include "machine/c8280.h" |
| 112 | #include "machine/c9060.h" |
| 110 | 113 | #include "machine/cbmipt.h" |
| 111 | 114 | #include "video/vic6567.h" |
| 112 | 115 | #include "video/mc6845.h" |
| r13219 | r13220 | |
| 411 | 414 | DEVCB_NULL |
| 412 | 415 | }; |
| 413 | 416 | |
| 414 | | static IEEE488_DAISY( ieee488_daisy ) |
| 417 | static 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) |
| 428 | SLOT_INTERFACE_END |
| 429 | |
| 430 | static IEEE488_INTERFACE( ieee488_intf ) |
| 415 | 431 | { |
| 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 |
| 418 | 440 | }; |
| 419 | 441 | |
| 420 | 442 | static MACHINE_CONFIG_START( cbm600, cbmb_state ) |
| r13219 | r13220 | |
| 457 | 479 | MCFG_TPI6525_ADD("tpi6525_1", cbmb_tpi_1_intf) |
| 458 | 480 | |
| 459 | 481 | /* 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) |
| 462 | 487 | |
| 463 | 488 | MCFG_FRAGMENT_ADD(cbmb_cartslot) |
| 464 | 489 | MACHINE_CONFIG_END |
| r13219 | r13220 | |
| 533 | 558 | MCFG_TPI6525_ADD("tpi6525_1", cbmb_tpi_1_intf) |
| 534 | 559 | |
| 535 | 560 | /* 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) |
| 538 | 566 | |
| 539 | 567 | MCFG_FRAGMENT_ADD(cbmb_cartslot) |
| 540 | 568 | MACHINE_CONFIG_END |
src/mess/drivers/pet.c
| r13219 | r13220 | |
| 388 | 388 | #include "machine/cbmipt.h" |
| 389 | 389 | #include "video/mc6845.h" |
| 390 | 390 | #include "machine/ram.h" |
| 391 | #include "machine/c2031.h" |
| 391 | 392 | #include "machine/c2040.h" |
| 392 | 393 | #include "machine/c8280.h" |
| 393 | 394 | #include "machine/c9060.h" |
| r13219 | r13220 | |
| 646 | 647 | return 0; |
| 647 | 648 | } |
| 648 | 649 | |
| 649 | | static IEEE488_DAISY( ieee488_daisy ) |
| 650 | | { |
| 651 | | { "drive" }, |
| 652 | | { NULL} |
| 653 | | }; |
| 650 | static 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) |
| 661 | SLOT_INTERFACE_END |
| 654 | 662 | |
| 655 | 663 | static IEEE488_INTERFACE( ieee488_intf ) |
| 656 | 664 | { |
| r13219 | r13220 | |
| 715 | 723 | MCFG_RAM_EXTRA_OPTIONS("8K,16K") |
| 716 | 724 | |
| 717 | 725 | /* 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) |
| 720 | 731 | MACHINE_CONFIG_END |
| 721 | 732 | |
| 722 | 733 | |
| r13219 | r13220 | |
| 734 | 745 | MCFG_RAM_EXTRA_OPTIONS("4K") |
| 735 | 746 | |
| 736 | 747 | /* 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) |
| 739 | 753 | MACHINE_CONFIG_END |
| 740 | 754 | |
| 741 | 755 | |
| r13219 | r13220 | |
| 788 | 802 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 789 | 803 | |
| 790 | 804 | /* 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) |
| 793 | 810 | MACHINE_CONFIG_END |
| 794 | 811 | |
| 795 | 812 | |