src/mess/machine/conkort.c
| r9100 | r9101 | |
| 178 | 178 | --------------- |
| 179 | 179 | - controller reads a couple of sectors on boot, bails out, and starts to STEP_OUT ad infinitum |
| 180 | 180 | - Z80 DMA reset command is broken (it keeps resetting A/B port addresses) |
| 181 | | - status bit 0 (busy) ? |
| 182 | 181 | - 2KB RAM option |
| 183 | 182 | - some SW2 options make controller try to WRITE_TRK |
| 184 | 183 | |
| r9100 | r9101 | |
| 244 | 243 | int fdc_irq; /* FDC interrupt */ |
| 245 | 244 | int dma_irq; /* DMA interrupt */ |
| 246 | 245 | int busy; /* busy bit */ |
| 246 | int force_busy; /* force busy bit */ |
| 247 | 247 | |
| 248 | 248 | /* devices */ |
| 249 | 249 | running_device *bus; |
| r9100 | r9101 | |
| 396 | 396 | conkort->sel1 = BIT(data, 1); |
| 397 | 397 | |
| 398 | 398 | /* motor enable */ |
| 399 | | floppy_mon_w(conkort->image0, BIT(data, 3)); |
| 400 | | floppy_mon_w(conkort->image1, BIT(data, 3)); |
| 401 | | floppy_drive_set_ready_state(conkort->image0, 1, 1); |
| 402 | | floppy_drive_set_ready_state(conkort->image1, 1, 1); |
| 399 | int mtron = BIT(data, 3); |
| 400 | floppy_mon_w(conkort->image0, mtron); |
| 401 | floppy_mon_w(conkort->image1, mtron); |
| 402 | floppy_drive_set_ready_state(conkort->image0, !mtron, 1); |
| 403 | floppy_drive_set_ready_state(conkort->image1, !mtron, 1); |
| 403 | 404 | |
| 404 | 405 | /* disk side selection */ |
| 405 | 406 | //wd17xx_set_side(device, BIT(data, 4)); |
| r9100 | r9101 | |
| 495 | 496 | { |
| 496 | 497 | fast_t *conkort = get_safe_token_fast(device); |
| 497 | 498 | |
| 498 | | UINT8 data = 0xff; |
| 499 | UINT8 data = 0; |
| 499 | 500 | |
| 500 | 501 | if (conkort->cs) |
| 501 | 502 | { |
| 502 | | // LS240 inverts the data, D4/D5 not connected |
| 503 | | data = (~conkort->status & 0xcf) | 0x30 | !(conkort->busy & BIT(conkort->status, 0)); |
| 503 | data = (conkort->status & 0xce) | conkort->busy; |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | | return data; |
| 506 | // LS240 inverts the data |
| 507 | return data ^ 0xff; |
| 507 | 508 | } |
| 508 | 509 | |
| 509 | 510 | READ8_DEVICE_HANDLER( luxor_55_21046_inp_r ) |
| r9100 | r9101 | |
| 566 | 567 | { |
| 567 | 568 | fast_t *conkort = get_safe_token_fast(device->owner()); |
| 568 | 569 | |
| 569 | | conkort->busy = 0; |
| 570 | if (BIT(conkort->status, 0)) |
| 571 | { |
| 572 | conkort->busy = 0; |
| 573 | } |
| 570 | 574 | |
| 571 | 575 | return conkort->data_in; |
| 572 | 576 | } |
| r9100 | r9101 | |
| 575 | 579 | { |
| 576 | 580 | fast_t *conkort = get_safe_token_fast(device->owner()); |
| 577 | 581 | |
| 578 | | conkort->busy = 0; |
| 582 | if (BIT(conkort->status, 0)) |
| 583 | { |
| 584 | conkort->busy = 0; |
| 585 | } |
| 579 | 586 | |
| 580 | 587 | conkort->data_out = data; |
| 581 | 588 | } |
| r9100 | r9101 | |
| 586 | 593 | |
| 587 | 594 | bit description |
| 588 | 595 | |
| 589 | | 0 busy |
| 590 | | 1 index pulse/DRQ |
| 591 | | 2 track 0/lost data |
| 592 | | 3 CRC error |
| 593 | | 4 seek error/RNF |
| 594 | | 5 head loaded/write fault |
| 595 | | 6 write protect |
| 596 | | 7 not ready |
| 596 | 0 force busy |
| 597 | 1 |
| 598 | 2 |
| 599 | 3 |
| 600 | 4 N/C |
| 601 | 5 N/C |
| 602 | 6 |
| 603 | 7 |
| 597 | 604 | |
| 598 | 605 | */ |
| 599 | 606 | |
| r9100 | r9101 | |
| 601 | 608 | |
| 602 | 609 | conkort->status = data; |
| 603 | 610 | |
| 604 | | if (BIT(data, 0)) |
| 611 | /* busy */ |
| 612 | if (!BIT(conkort->status, 0)) |
| 605 | 613 | { |
| 606 | | conkort->busy = 0; |
| 614 | conkort->busy = 1; |
| 607 | 615 | } |
| 608 | 616 | } |
| 609 | 617 | |
| r9100 | r9101 | |
| 613 | 621 | |
| 614 | 622 | bit description |
| 615 | 623 | |
| 616 | | 0 _MOTEA |
| 617 | | 1 _DRVSB |
| 618 | | 2 _DRVSA |
| 619 | | 3 _MOTEB |
| 624 | 0 DS0 |
| 625 | 1 DS1 |
| 626 | 2 DS2 |
| 627 | 3 MTRON |
| 620 | 628 | 4 pin 2 of 50-pin floppy connector, not used |
| 621 | | 5 _SIDE1 |
| 629 | 5 SIDE1 |
| 622 | 630 | 6 |
| 623 | 631 | 7 |
| 624 | 632 | |
| r9100 | r9101 | |
| 626 | 634 | |
| 627 | 635 | fast_t *conkort = get_safe_token_fast(device->owner()); |
| 628 | 636 | |
| 629 | | /* motor enable */ |
| 630 | | floppy_mon_w(conkort->image0, !BIT(data, 0)); |
| 631 | | floppy_mon_w(conkort->image1, !BIT(data, 3)); |
| 632 | | floppy_drive_set_ready_state(conkort->image0, 1, 1); |
| 633 | | floppy_drive_set_ready_state(conkort->image1, 1, 1); |
| 634 | | |
| 635 | 637 | /* drive select */ |
| 636 | | if (BIT(data, 2)) wd17xx_set_drive(device, 0); |
| 638 | if (BIT(data, 0)) wd17xx_set_drive(device, 0); |
| 637 | 639 | if (BIT(data, 1)) wd17xx_set_drive(device, 1); |
| 640 | //if (BIT(data, 2)) wd17xx_set_drive(device, 2); |
| 638 | 641 | |
| 642 | /* motor enable */ |
| 643 | int mtron = BIT(data, 3); |
| 644 | floppy_mon_w(conkort->image0, !mtron); |
| 645 | floppy_mon_w(conkort->image1, !mtron); |
| 646 | floppy_drive_set_ready_state(conkort->image0, mtron, 1); |
| 647 | floppy_drive_set_ready_state(conkort->image1, mtron, 1); |
| 648 | |
| 639 | 649 | /* side select */ |
| 640 | 650 | wd17xx_set_side(device, BIT(data, 5)); |
| 641 | 651 | } |
| r9100 | r9101 | |
| 688 | 698 | UINT8 data = 0; |
| 689 | 699 | |
| 690 | 700 | /* busy */ |
| 691 | | data |= (conkort->busy & BIT(conkort->status, 0)); |
| 701 | data |= conkort->busy; |
| 692 | 702 | |
| 693 | 703 | /* SW1 */ |
| 694 | 704 | UINT8 sw1 = input_port_read(device->machine, "luxor_55_21046:SW1") & 0x0f; |