src/mess/machine/vic1112.c
| r7034 | r7035 | |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | 11 | #include "vic1112.h" |
| 12 | #include "cpu/m6502/m6502.h" |
| 12 | 13 | #include "machine/6522via.h" |
| 14 | #include "machine/ieee488.h" |
| 13 | 15 | |
| 14 | 16 | /*************************************************************************** |
| 15 | 17 | PARAMETERS |
| r7034 | r7035 | |
| 27 | 29 | { |
| 28 | 30 | const device_config *via0; |
| 29 | 31 | const device_config *via1; |
| 30 | | const device_config *ieee_bus; |
| 32 | const device_config *bus; |
| 31 | 33 | }; |
| 32 | 34 | |
| 33 | 35 | /*************************************************************************** |
| r7034 | r7035 | |
| 54 | 56 | ***************************************************************************/ |
| 55 | 57 | |
| 56 | 58 | /*------------------------------------------------- |
| 59 | vic1112_ieee488_srq_w - IEEE-488 service |
| 60 | request |
| 61 | -------------------------------------------------*/ |
| 62 | |
| 63 | WRITE_LINE_DEVICE_HANDLER( vic1112_ieee488_srq_w ) |
| 64 | { |
| 65 | vic1112_t *vic1112 = get_safe_token(device); |
| 66 | |
| 67 | via_cb1_w(vic1112->bus, state); |
| 68 | } |
| 69 | |
| 70 | /*------------------------------------------------- |
| 57 | 71 | via6522_interface vic1112_via0_intf |
| 58 | 72 | -------------------------------------------------*/ |
| 59 | 73 | |
| 74 | static WRITE_LINE_DEVICE_HANDLER( via_irq_w ) |
| 75 | { |
| 76 | cpu_set_input_line(device->machine->firstcpu, M6502_IRQ_LINE, state); |
| 77 | } |
| 78 | |
| 60 | 79 | static READ8_DEVICE_HANDLER( via0_pb_r ) |
| 61 | 80 | { |
| 62 | 81 | /* |
| r7034 | r7035 | |
| 74 | 93 | |
| 75 | 94 | */ |
| 76 | 95 | |
| 77 | | return 0; |
| 96 | vic1112_t *vic1112 = get_safe_token(device->owner); |
| 97 | UINT8 data = 0; |
| 98 | |
| 99 | /* data valid in */ |
| 100 | data |= ieee488_dav_r(vic1112->bus) << 4; |
| 101 | |
| 102 | /* not ready for data in */ |
| 103 | data |= ieee488_nrfd_r(vic1112->bus) << 5; |
| 104 | |
| 105 | /* not data accepted in */ |
| 106 | data |= ieee488_ndac_r(vic1112->bus) << 6; |
| 107 | |
| 108 | /* attention in */ |
| 109 | data |= ieee488_atn_r(vic1112->bus) << 7; |
| 110 | |
| 111 | return data; |
| 78 | 112 | } |
| 79 | 113 | |
| 80 | 114 | static WRITE8_DEVICE_HANDLER( via0_pb_w ) |
| r7034 | r7035 | |
| 93 | 127 | PB7 _ATN IN |
| 94 | 128 | |
| 95 | 129 | */ |
| 130 | |
| 131 | vic1112_t *vic1112 = get_safe_token(device->owner); |
| 132 | |
| 133 | /* data valid out */ |
| 134 | ieee488_dav_w(vic1112->bus, device->owner, BIT(data, 0)); |
| 135 | |
| 136 | /* not ready for data out */ |
| 137 | ieee488_nrfd_w(vic1112->bus, device->owner, BIT(data, 1)); |
| 138 | |
| 139 | /* not data accepted out */ |
| 140 | ieee488_ndac_w(vic1112->bus, device->owner, BIT(data, 2)); |
| 141 | |
| 142 | /* end or identify */ |
| 143 | ieee488_eoi_w(vic1112->bus, device->owner, BIT(data, 3)); |
| 96 | 144 | } |
| 97 | 145 | |
| 98 | 146 | static const via6522_interface vic1112_via0_intf = |
| r7034 | r7035 | |
| 111 | 159 | DEVCB_NULL, |
| 112 | 160 | DEVCB_NULL, |
| 113 | 161 | |
| 114 | | DEVCB_NULL |
| 162 | DEVCB_LINE(via_irq_w) |
| 115 | 163 | }; |
| 116 | 164 | |
| 117 | 165 | /*------------------------------------------------- |
| r7034 | r7035 | |
| 135 | 183 | |
| 136 | 184 | */ |
| 137 | 185 | |
| 138 | | return 0; |
| 186 | vic1112_t *vic1112 = get_safe_token(device->owner); |
| 187 | |
| 188 | return ieee488_dio_r(vic1112->bus, 0); |
| 139 | 189 | } |
| 140 | 190 | |
| 141 | 191 | static WRITE8_DEVICE_HANDLER( via1_pb_w ) |
| r7034 | r7035 | |
| 154 | 204 | PB7 DO8 |
| 155 | 205 | |
| 156 | 206 | */ |
| 207 | |
| 208 | vic1112_t *vic1112 = get_safe_token(device->owner); |
| 209 | |
| 210 | ieee488_dio_w(vic1112->bus, 0, data); |
| 157 | 211 | } |
| 158 | 212 | |
| 213 | static WRITE_LINE_DEVICE_HANDLER( via1_ca2_w ) |
| 214 | { |
| 215 | vic1112_t *vic1112 = get_safe_token(device->owner); |
| 216 | |
| 217 | /* attention out */ |
| 218 | ieee488_atn_w(vic1112->bus, device->owner, state); |
| 219 | } |
| 220 | |
| 221 | static WRITE_LINE_DEVICE_HANDLER( via1_cb2_w ) |
| 222 | { |
| 223 | vic1112_t *vic1112 = get_safe_token(device->owner); |
| 224 | |
| 225 | /* end or identify out */ |
| 226 | ieee488_eoi_w(vic1112->bus, device->owner, state); |
| 227 | } |
| 228 | |
| 159 | 229 | static const via6522_interface vic1112_via1_intf = |
| 160 | 230 | { |
| 161 | 231 | DEVCB_HANDLER(via1_pa_r), |
| 162 | 232 | DEVCB_NULL, |
| 163 | 233 | DEVCB_NULL, |
| 234 | DEVCB_NULL, /* _SRQ IN */ |
| 164 | 235 | DEVCB_NULL, |
| 165 | 236 | DEVCB_NULL, |
| 166 | | DEVCB_NULL, |
| 167 | 237 | |
| 168 | 238 | DEVCB_NULL, |
| 169 | 239 | DEVCB_HANDLER(via1_pb_w), |
| 170 | 240 | DEVCB_NULL, |
| 171 | | DEVCB_NULL, // _SRQ IN |
| 172 | | DEVCB_NULL, // _ATN OUT |
| 173 | | DEVCB_NULL, // _EOI |
| 241 | DEVCB_NULL, |
| 242 | DEVCB_LINE(via1_ca2_w), |
| 243 | DEVCB_LINE(via1_cb2_w), |
| 174 | 244 | |
| 175 | | DEVCB_NULL |
| 245 | DEVCB_LINE(via_irq_w) |
| 176 | 246 | }; |
| 177 | 247 | |
| 178 | 248 | /*------------------------------------------------- |
| r7034 | r7035 | |
| 189 | 259 | -------------------------------------------------*/ |
| 190 | 260 | |
| 191 | 261 | ROM_START( vic1112 ) |
| 192 | | ROM_REGION( 0x800, "vic1112", ROMREGION_LOADBYNAME ) |
| 193 | | ROM_LOAD( "325329-03.u2", 0x000, 0x800, CRC(dd6147ba) SHA1(3945b9aa417f5905fa52f6f667a3e22add7ab15f) ) |
| 262 | ROM_REGION( 0x800, VIC1112_TAG, ROMREGION_LOADBYNAME ) |
| 263 | ROM_LOAD( "325329-03.u2", 0x000, 0x800, CRC(d37b6335) SHA1(828c965829d21c60e8c2d083caee045c639a270f) ) |
| 194 | 264 | ROM_END |
| 195 | 265 | |
| 196 | 266 | /*------------------------------------------------- |
| r7034 | r7035 | |
| 201 | 271 | { |
| 202 | 272 | vic1112_t *vic1112 = get_safe_token(device); |
| 203 | 273 | const vic1112_config *config = get_safe_config(device); |
| 274 | const address_space *program = cpu_get_address_space(device->machine->firstcpu, ADDRESS_SPACE_PROGRAM); |
| 204 | 275 | |
| 205 | | /* set IEEE address */ |
| 206 | | |
| 207 | 276 | /* find devices */ |
| 208 | 277 | vic1112->via0 = device_find_child_by_tag(device, M6522_0_TAG); |
| 209 | 278 | vic1112->via1 = device_find_child_by_tag(device, M6522_1_TAG); |
| 210 | | vic1112->ieee_bus = devtag_get_device(device->machine, config->ieee_bus_tag); |
| 279 | vic1112->bus = devtag_get_device(device->machine, config->bus_tag); |
| 211 | 280 | |
| 212 | 281 | /* set VIA clocks */ |
| 213 | 282 | device_set_clock(vic1112->via0, cpu_get_clock(device->machine->firstcpu)); |
| 214 | 283 | device_set_clock(vic1112->via1, cpu_get_clock(device->machine->firstcpu)); |
| 215 | 284 | |
| 216 | | /* register for state saving */ |
| 217 | | // state_save_register_device_item(device, 0, vic1112->); |
| 285 | /* map VIAs to memory */ |
| 286 | memory_install_readwrite8_device_handler(program, vic1112->via0, 0x9200, 0x920f, 0, 0, via_r, via_w); |
| 287 | memory_install_readwrite8_device_handler(program, vic1112->via1, 0x9210, 0x921f, 0, 0, via_r, via_w); |
| 288 | |
| 289 | /* map ROM to memory */ |
| 290 | memory_install_rom(program, 0xb000, 0xb7ff, 0, 0, memory_region(device->machine, VIC1112_TAG)); |
| 218 | 291 | } |
| 219 | 292 | |
| 220 | 293 | /*------------------------------------------------- |
| r7034 | r7035 | |
| 230 | 303 | device_reset(vic1112->via1); |
| 231 | 304 | |
| 232 | 305 | /* _IFC */ |
| 306 | ieee488_ifc_w(vic1112->bus, device, 0); |
| 307 | ieee488_ifc_w(vic1112->bus, device, 1); |
| 233 | 308 | } |
| 234 | 309 | |
| 235 | 310 | /*------------------------------------------------- |
src/mess/machine/vic1112.h
| r7034 | r7035 | |
| 20 | 20 | |
| 21 | 21 | #define VIC1112 DEVICE_GET_INFO_NAME( vic1112 ) |
| 22 | 22 | |
| 23 | | #define MDRV_VIC1112_ADD(_ieee_bus_tag) \ |
| 23 | #define MDRV_VIC1112_ADD(_bus_tag) \ |
| 24 | 24 | MDRV_DEVICE_ADD(VIC1112_TAG, VIC1112, 0) \ |
| 25 | | MDRV_DEVICE_CONFIG_DATAPTR(vic1112_config, ieee_bus_tag, _ieee_bus_tag) \ |
| 25 | MDRV_DEVICE_CONFIG_DATAPTR(vic1112_config, bus_tag, _bus_tag) \ |
| 26 | 26 | |
| 27 | #define VIC1112_IEEE488 \ |
| 28 | VIC1112_TAG, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_DEVICE_LINE(VIC1112_TAG, vic1112_ieee488_srq_w), DEVCB_NULL, DEVCB_NULL |
| 29 | |
| 27 | 30 | /*************************************************************************** |
| 28 | 31 | TYPE DEFINITIONS |
| 29 | 32 | ***************************************************************************/ |
| r7034 | r7035 | |
| 31 | 34 | typedef struct _vic1112_config vic1112_config; |
| 32 | 35 | struct _vic1112_config |
| 33 | 36 | { |
| 34 | | const char *ieee_bus_tag; /* IEEE bus device */ |
| 37 | const char *bus_tag; /* bus device */ |
| 35 | 38 | }; |
| 36 | 39 | |
| 37 | 40 | /*************************************************************************** |
| r7034 | r7035 | |
| 41 | 44 | /* device interface */ |
| 42 | 45 | DEVICE_GET_INFO( vic1112 ); |
| 43 | 46 | |
| 47 | /* IEEE-488 interface */ |
| 48 | WRITE_LINE_DEVICE_HANDLER( vic1112_ieee488_srq_w ); |
| 49 | |
| 44 | 50 | #endif |
src/mess/machine/c1541.c
| r7034 | r7035 | |
| 142 | 142 | #include "formats/g64_dsk.h" |
| 143 | 143 | #include "machine/6522via.h" |
| 144 | 144 | #include "machine/cbmiec.h" |
| 145 | #include "machine/ieee488.h" |
| 145 | 146 | |
| 146 | 147 | /*************************************************************************** |
| 147 | 148 | PARAMETERS |
| r7034 | r7035 | |
| 201 | 202 | const device_config *cpu; |
| 202 | 203 | const device_config *via0; |
| 203 | 204 | const device_config *via1; |
| 204 | | const device_config *serial_bus; |
| 205 | const device_config *bus; |
| 205 | 206 | const device_config *image; |
| 206 | 207 | |
| 207 | 208 | /* timers */ |
| r7034 | r7035 | |
| 300 | 301 | |
| 301 | 302 | via_ca1_w(c1541->via0, !state); |
| 302 | 303 | |
| 303 | | cbm_iec_data_w(c1541->serial_bus, device, data_out); |
| 304 | cbm_iec_data_w(c1541->bus, device, data_out); |
| 304 | 305 | } |
| 305 | 306 | |
| 306 | 307 | /*------------------------------------------------- |
| r7034 | r7035 | |
| 316 | 317 | } |
| 317 | 318 | |
| 318 | 319 | /*------------------------------------------------- |
| 320 | c2031_ieee488_atn_w - IEEE-488 bus attention |
| 321 | -------------------------------------------------*/ |
| 322 | |
| 323 | WRITE_LINE_DEVICE_HANDLER( c2031_ieee488_atn_w ) |
| 324 | { |
| 325 | c1541_t *c1541 = get_safe_token(device); |
| 326 | |
| 327 | via_ca1_w(c1541->via0, state); |
| 328 | } |
| 329 | |
| 330 | /*------------------------------------------------- |
| 331 | c2031_ieee488_ifc_w - IEEE-488 bus reset |
| 332 | -------------------------------------------------*/ |
| 333 | |
| 334 | WRITE_LINE_DEVICE_HANDLER( c2031_ieee488_ifc_w ) |
| 335 | { |
| 336 | if (!state) |
| 337 | { |
| 338 | device_reset(device); |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | /*------------------------------------------------- |
| 319 | 343 | ADDRESS_MAP( c1540_map ) |
| 320 | 344 | -------------------------------------------------*/ |
| 321 | 345 | |
| r7034 | r7035 | |
| 410 | 434 | UINT8 data = 0; |
| 411 | 435 | |
| 412 | 436 | /* data in */ |
| 413 | | data = !cbm_iec_data_r(c1541->serial_bus); |
| 437 | data = !cbm_iec_data_r(c1541->bus); |
| 414 | 438 | |
| 415 | 439 | /* clock in */ |
| 416 | | data |= !cbm_iec_clk_r(c1541->serial_bus) << 2; |
| 440 | data |= !cbm_iec_clk_r(c1541->bus) << 2; |
| 417 | 441 | |
| 418 | 442 | /* serial bus address */ |
| 419 | 443 | data |= c1541->address << 5; |
| 420 | 444 | |
| 421 | 445 | /* attention in */ |
| 422 | | data |= !cbm_iec_atn_r(c1541->serial_bus) << 7; |
| 446 | data |= !cbm_iec_atn_r(c1541->bus) << 7; |
| 423 | 447 | |
| 424 | 448 | return data; |
| 425 | 449 | } |
| r7034 | r7035 | |
| 448 | 472 | int atna = BIT(data, 4); |
| 449 | 473 | |
| 450 | 474 | /* data out */ |
| 451 | | int serial_data = !data_out && !(atna ^ !cbm_iec_atn_r(c1541->serial_bus)); |
| 452 | | cbm_iec_data_w(c1541->serial_bus, device->owner, serial_data); |
| 475 | int serial_data = !data_out && !(atna ^ !cbm_iec_atn_r(c1541->bus)); |
| 476 | cbm_iec_data_w(c1541->bus, device->owner, serial_data); |
| 453 | 477 | c1541->data_out = data_out; |
| 454 | 478 | |
| 455 | 479 | /* clock out */ |
| 456 | | cbm_iec_clk_w(c1541->serial_bus, device->owner, !clk_out); |
| 480 | cbm_iec_clk_w(c1541->bus, device->owner, !clk_out); |
| 457 | 481 | |
| 458 | 482 | /* attention acknowledge */ |
| 459 | 483 | c1541->atna = atna; |
| r7034 | r7035 | |
| 544 | 568 | |
| 545 | 569 | */ |
| 546 | 570 | |
| 547 | | return 0; |
| 571 | c1541_t *c1541 = get_safe_token(device->owner); |
| 572 | |
| 573 | return ieee488_dio_r(c1541->bus, 0); |
| 548 | 574 | } |
| 549 | 575 | |
| 550 | 576 | static WRITE8_DEVICE_HANDLER( c2031_via0_pa_w ) |
| r7034 | r7035 | |
| 563 | 589 | PA7 DI7 |
| 564 | 590 | |
| 565 | 591 | */ |
| 592 | |
| 593 | c1541_t *c1541 = get_safe_token(device->owner); |
| 594 | |
| 595 | ieee488_dio_w(c1541->bus, 0, data); |
| 566 | 596 | } |
| 567 | 597 | |
| 568 | 598 | static READ8_DEVICE_HANDLER( c2031_via0_pb_r ) |
| r7034 | r7035 | |
| 582 | 612 | |
| 583 | 613 | */ |
| 584 | 614 | |
| 585 | | return 0; |
| 615 | c1541_t *c1541 = get_safe_token(device->owner); |
| 616 | UINT8 data = 0; |
| 617 | |
| 618 | /* not ready for data */ |
| 619 | data |= ieee488_nrfd_r(c1541->bus) << 1; |
| 620 | |
| 621 | /* not data accepted */ |
| 622 | data |= ieee488_ndac_r(c1541->bus) << 2; |
| 623 | |
| 624 | /* end or identify */ |
| 625 | data |= ieee488_eoi_r(c1541->bus) << 3; |
| 626 | |
| 627 | /* data valid */ |
| 628 | data |= ieee488_dav_r(c1541->bus) << 6; |
| 629 | |
| 630 | /* attention */ |
| 631 | data |= ieee488_atn_r(c1541->bus) << 7; |
| 632 | |
| 633 | return data; |
| 586 | 634 | } |
| 587 | 635 | |
| 588 | 636 | static WRITE8_DEVICE_HANDLER( c2031_via0_pb_w ) |
| r7034 | r7035 | |
| 601 | 649 | PB7 _ATN |
| 602 | 650 | |
| 603 | 651 | */ |
| 652 | |
| 653 | c1541_t *c1541 = get_safe_token(device->owner); |
| 654 | |
| 655 | /* attention acknowledge */ |
| 656 | |
| 657 | /* not ready for data */ |
| 658 | ieee488_nrfd_w(c1541->bus, device->owner, BIT(data, 1)); |
| 659 | |
| 660 | /* not data accepted */ |
| 661 | ieee488_ndac_w(c1541->bus, device->owner, BIT(data, 2)); |
| 662 | |
| 663 | /* end or identify */ |
| 664 | ieee488_eoi_w(c1541->bus, device->owner, BIT(data, 3)); |
| 604 | 665 | } |
| 605 | 666 | |
| 667 | static READ_LINE_DEVICE_HANDLER( c2031_via0_ca1_r ) |
| 668 | { |
| 669 | c1541_t *c1541 = get_safe_token(device->owner); |
| 670 | |
| 671 | return ieee488_atn_r(c1541->bus); |
| 672 | } |
| 673 | |
| 674 | static READ_LINE_DEVICE_HANDLER( c2031_via0_ca2_r ) |
| 675 | { |
| 676 | /* device # selection */ |
| 677 | return 0; |
| 678 | } |
| 679 | |
| 606 | 680 | static const via6522_interface c2031_via0_intf = |
| 607 | 681 | { |
| 608 | 682 | DEVCB_HANDLER(c2031_via0_pa_r), |
| 609 | 683 | DEVCB_HANDLER(c2031_via0_pb_r), |
| 684 | DEVCB_LINE(c2031_via0_ca1_r), |
| 610 | 685 | DEVCB_NULL, |
| 686 | DEVCB_LINE(c2031_via0_ca2_r), |
| 611 | 687 | DEVCB_NULL, |
| 612 | | DEVCB_NULL, |
| 613 | | DEVCB_NULL, |
| 614 | 688 | |
| 615 | 689 | DEVCB_HANDLER(c2031_via0_pa_w), |
| 616 | 690 | DEVCB_HANDLER(c2031_via0_pb_w), |
| 617 | 691 | DEVCB_NULL, |
| 618 | 692 | DEVCB_NULL, |
| 619 | 693 | DEVCB_NULL, |
| 620 | | DEVCB_NULL, |
| 694 | DEVCB_NULL, /* PLL SYN */ |
| 621 | 695 | |
| 622 | 696 | DEVCB_LINE(via0_irq_w) |
| 623 | 697 | }; |
| r7034 | r7035 | |
| 1011 | 1085 | /* find devices */ |
| 1012 | 1086 | c1541->via0 = device_find_child_by_tag(device, M6522_0_TAG); |
| 1013 | 1087 | c1541->via1 = device_find_child_by_tag(device, M6522_1_TAG); |
| 1014 | | c1541->serial_bus = devtag_get_device(device->machine, config->serial_bus_tag); |
| 1088 | c1541->bus = devtag_get_device(device->machine, config->bus_tag); |
| 1015 | 1089 | c1541->image = device_find_child_by_tag(device, FLOPPY_0); |
| 1016 | 1090 | |
| 1017 | 1091 | /* allocate track buffer */ |
src/mess/machine/c1541.h
| r7034 | r7035 | |
| 22 | 22 | #define C1541II DEVICE_GET_INFO_NAME( c1541ii ) |
| 23 | 23 | #define C2031 DEVICE_GET_INFO_NAME( c2031 ) |
| 24 | 24 | |
| 25 | | #define MDRV_C1540_ADD(_tag, _serial_bus_tag, _address) \ |
| 25 | #define MDRV_C1540_ADD(_tag, _bus_tag, _address) \ |
| 26 | 26 | MDRV_DEVICE_ADD(_tag, C1540, 0) \ |
| 27 | | MDRV_DEVICE_CONFIG_DATAPTR(c1541_config, serial_bus_tag, _serial_bus_tag) \ |
| 27 | MDRV_DEVICE_CONFIG_DATAPTR(c1541_config, bus_tag, _bus_tag) \ |
| 28 | 28 | MDRV_DEVICE_CONFIG_DATA32(c1541_config, address, _address) |
| 29 | 29 | |
| 30 | | #define MDRV_C1541_ADD(_tag, _serial_bus_tag, _address) \ |
| 30 | #define MDRV_C1541_ADD(_tag, _bus_tag, _address) \ |
| 31 | 31 | MDRV_DEVICE_ADD(_tag, C1541, 0) \ |
| 32 | | MDRV_DEVICE_CONFIG_DATAPTR(c1541_config, serial_bus_tag, _serial_bus_tag) \ |
| 32 | MDRV_DEVICE_CONFIG_DATAPTR(c1541_config, bus_tag, _bus_tag) \ |
| 33 | 33 | MDRV_DEVICE_CONFIG_DATA32(c1541_config, address, _address) |
| 34 | 34 | |
| 35 | | #define MDRV_C1541C_ADD(_tag, _serial_bus_tag, _address) \ |
| 35 | #define MDRV_C1541C_ADD(_tag, _bus_tag, _address) \ |
| 36 | 36 | MDRV_DEVICE_ADD(_tag, C1541C, 0) \ |
| 37 | | MDRV_DEVICE_CONFIG_DATAPTR(c1541_config, serial_bus_tag, _serial_bus_tag) \ |
| 37 | MDRV_DEVICE_CONFIG_DATAPTR(c1541_config, bus_tag, _bus_tag) \ |
| 38 | 38 | MDRV_DEVICE_CONFIG_DATA32(c1541_config, address, _address) |
| 39 | 39 | |
| 40 | | #define MDRV_C1541II_ADD(_tag, _serial_bus_tag, _address) \ |
| 40 | #define MDRV_C1541II_ADD(_tag, _bus_tag, _address) \ |
| 41 | 41 | MDRV_DEVICE_ADD(_tag, C1541II, 0) \ |
| 42 | | MDRV_DEVICE_CONFIG_DATAPTR(c1541_config, serial_bus_tag, _serial_bus_tag) \ |
| 42 | MDRV_DEVICE_CONFIG_DATAPTR(c1541_config, bus_tag, _bus_tag) \ |
| 43 | 43 | MDRV_DEVICE_CONFIG_DATA32(c1541_config, address, _address) |
| 44 | 44 | |
| 45 | | #define MDRV_C2031_ADD(_tag, _address) \ |
| 45 | #define MDRV_C2031_ADD(_tag, _bus_tag, _address) \ |
| 46 | 46 | MDRV_DEVICE_ADD(_tag, C2031, 0) \ |
| 47 | MDRV_DEVICE_CONFIG_DATAPTR(c1541_config, bus_tag, _bus_tag) \ |
| 47 | 48 | MDRV_DEVICE_CONFIG_DATA32(c1541_config, address, _address) |
| 48 | 49 | |
| 49 | 50 | #define C1541_IEC(_tag) \ |
| 50 | 51 | _tag, DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, c1541_iec_atn_w), DEVCB_NULL, DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, c1541_iec_reset_w) |
| 51 | 52 | |
| 53 | #define C2031_IEEE488(_tag) \ |
| 54 | _tag, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, c2031_ieee488_ifc_w), DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, c2031_ieee488_atn_w), DEVCB_NULL |
| 55 | |
| 52 | 56 | /*************************************************************************** |
| 53 | 57 | TYPE DEFINITIONS |
| 54 | 58 | ***************************************************************************/ |
| r7034 | r7035 | |
| 56 | 60 | typedef struct _c1541_config c1541_config; |
| 57 | 61 | struct _c1541_config |
| 58 | 62 | { |
| 59 | | const char *serial_bus_tag; /* serial bus device */ |
| 60 | | int address; /* serial address */ |
| 63 | const char *bus_tag; /* bus device */ |
| 64 | int address; /* bus address */ |
| 61 | 65 | }; |
| 62 | 66 | |
| 63 | 67 | /*************************************************************************** |
| r7034 | r7035 | |
| 75 | 79 | WRITE_LINE_DEVICE_HANDLER( c1541_iec_atn_w ); |
| 76 | 80 | WRITE_LINE_DEVICE_HANDLER( c1541_iec_reset_w ); |
| 77 | 81 | |
| 82 | /* IEEE-488 interface */ |
| 83 | WRITE_LINE_DEVICE_HANDLER( c2031_ieee488_atn_w ); |
| 84 | WRITE_LINE_DEVICE_HANDLER( c2031_ieee488_ifc_w ); |
| 85 | |
| 78 | 86 | #endif |