src/mess/machine/conkort.c
| r9076 | r9077 | |
| 176 | 176 | |
| 177 | 177 | Fast Controller |
| 178 | 178 | --------------- |
| 179 | - status bit 0 |
| 179 | 180 | - drive select |
| 180 | 181 | - side select |
| 181 | 182 | - motor on |
| 182 | | - Z80 NMI |
| 183 | | - FDC INTRQ |
| 184 | | - CPU is in HALT waiting for the FDC interrupt after commands |
| 185 | 183 | |
| 186 | 184 | */ |
| 187 | 185 | |
| r9076 | r9077 | |
| 237 | 235 | { |
| 238 | 236 | int cs; /* card selected */ |
| 239 | 237 | UINT8 status; /* ABC BUS status */ |
| 240 | | UINT8 data; /* ABC BUS data */ |
| 238 | UINT8 data_in; /* ABC BUS data in */ |
| 239 | UINT8 data_out; /* ABC BUS data out */ |
| 241 | 240 | int fdc_irq; /* FDC interrupt */ |
| 242 | 241 | |
| 243 | 242 | /* devices */ |
| r9076 | r9077 | |
| 482 | 481 | |
| 483 | 482 | if (conkort->cs) |
| 484 | 483 | { |
| 485 | | data = conkort->status; |
| 484 | // TODO: D0 handling (NANDed with something) |
| 485 | // LS240 inverts the data, D4/D5 not connected |
| 486 | data = (~conkort->status & 0xcf) | 0x31; |
| 486 | 487 | } |
| 487 | 488 | |
| 488 | 489 | return data; |
| r9076 | r9077 | |
| 494 | 495 | |
| 495 | 496 | UINT8 data = 0xff; |
| 496 | 497 | |
| 497 | | if (conkort->cs && !BIT(conkort->status, 6)) |
| 498 | if (conkort->cs) |
| 498 | 499 | { |
| 499 | | data = conkort->data; |
| 500 | data = conkort->data_out; |
| 500 | 501 | } |
| 501 | 502 | |
| 502 | 503 | return data; |
| r9076 | r9077 | |
| 506 | 507 | { |
| 507 | 508 | fast_t *conkort = get_safe_token_fast(device); |
| 508 | 509 | |
| 509 | | if (conkort->cs && BIT(conkort->status, 6)) |
| 510 | if (conkort->cs) |
| 510 | 511 | { |
| 511 | | conkort->data = data; |
| 512 | conkort->data_in = data; |
| 512 | 513 | } |
| 513 | 514 | } |
| 514 | 515 | |
| r9076 | r9077 | |
| 541 | 542 | } |
| 542 | 543 | } |
| 543 | 544 | |
| 544 | | static READ8_DEVICE_HANDLER( fast_data_r ) |
| 545 | static READ8_DEVICE_HANDLER( fast_3d_r ) |
| 545 | 546 | { |
| 547 | /* |
| 548 | |
| 549 | bit description |
| 550 | |
| 551 | 0 |
| 552 | 1 |
| 553 | 2 |
| 554 | 3 |
| 555 | 4 |
| 556 | 5 |
| 557 | 6 |
| 558 | 7 |
| 559 | |
| 560 | */ |
| 561 | |
| 546 | 562 | fast_t *conkort = get_safe_token_fast(device->owner()); |
| 547 | 563 | |
| 548 | | return conkort->data; |
| 564 | return conkort->data_in; |
| 549 | 565 | } |
| 550 | 566 | |
| 551 | | static WRITE8_DEVICE_HANDLER( fast_data_w ) |
| 567 | static WRITE8_DEVICE_HANDLER( fast_4d_w ) |
| 552 | 568 | { |
| 553 | | fast_t *conkort = get_safe_token_fast(device->owner()); |
| 569 | /* |
| 554 | 570 | |
| 555 | | conkort->data = data; |
| 556 | | } |
| 571 | bit description |
| 557 | 572 | |
| 558 | | static WRITE8_DEVICE_HANDLER( fast_status_w ) |
| 559 | | { |
| 573 | 0 |
| 574 | 1 |
| 575 | 2 |
| 576 | 3 |
| 577 | 4 |
| 578 | 5 |
| 579 | 6 |
| 580 | 7 |
| 581 | |
| 582 | */ |
| 583 | |
| 560 | 584 | fast_t *conkort = get_safe_token_fast(device->owner()); |
| 561 | 585 | |
| 562 | | conkort->status = data; |
| 586 | conkort->data_out = data; |
| 563 | 587 | } |
| 564 | 588 | |
| 565 | | static WRITE8_DEVICE_HANDLER( fast_fdc_ctrl_w ) |
| 589 | static WRITE8_DEVICE_HANDLER( fast_4b_w ) |
| 566 | 590 | { |
| 567 | 591 | /* |
| 568 | 592 | |
| 569 | 593 | bit description |
| 570 | 594 | |
| 571 | | 0 FD1793 _MR |
| 572 | | 1 FD1793 _DDEN, FDC9229 DENS |
| 573 | | 2 FDC9229 MINI |
| 574 | | 3 ? |
| 575 | | 4 FDC9229 P2 |
| 576 | | 5 FDC9229 P1 |
| 577 | | 6 |
| 578 | | 7 |
| 595 | 0 |
| 596 | 1 |
| 597 | 2 |
| 598 | 3 |
| 599 | 4 |
| 600 | 5 |
| 601 | 6 |
| 602 | 7 |
| 579 | 603 | |
| 580 | | FDC9229 P0 is grounded |
| 581 | | |
| 582 | 604 | */ |
| 583 | 605 | |
| 584 | | /* master reset */ |
| 585 | | wd17xx_mr_w(device, BIT(data, 0)); |
| 606 | fast_t *conkort = get_safe_token_fast(device->owner()); |
| 586 | 607 | |
| 587 | | /* density select */ |
| 588 | | wd17xx_dden_w(device, BIT(data, 1)); |
| 589 | | |
| 590 | | logerror("0x30 %02x\n", data); |
| 608 | conkort->status = data; |
| 591 | 609 | } |
| 592 | 610 | |
| 593 | | static WRITE8_DEVICE_HANDLER( fast_other_w ) |
| 611 | static WRITE8_DEVICE_HANDLER( fast_9b_w ) |
| 594 | 612 | { |
| 595 | 613 | /* |
| 596 | 614 | |
| r9076 | r9077 | |
| 605 | 623 | 6 |
| 606 | 624 | 7 |
| 607 | 625 | |
| 608 | | this has to be drive/side select |
| 626 | */ |
| 609 | 627 | |
| 628 | /* side select */ |
| 629 | //wd17xx_set_side(device, BIT(data, 3)); |
| 630 | } |
| 631 | |
| 632 | static WRITE8_DEVICE_HANDLER( fast_8a_w ) |
| 633 | { |
| 634 | /* |
| 635 | |
| 636 | bit description |
| 637 | |
| 638 | 0 FD1793 _MR |
| 639 | 1 FD1793 _DDEN, FDC9229 DENS |
| 640 | 2 FDC9229 MINI |
| 641 | 3 READY signal polarity (0=inverted) |
| 642 | 4 FDC9229 P2 |
| 643 | 5 FDC9229 P1 |
| 644 | 6 |
| 645 | 7 |
| 646 | |
| 647 | FDC9229 P0 is grounded |
| 648 | |
| 610 | 649 | */ |
| 611 | | logerror("0x40 %02x\n", data); |
| 650 | |
| 651 | /* master reset */ |
| 652 | wd17xx_mr_w(device, BIT(data, 0)); |
| 653 | |
| 654 | /* density select */ |
| 655 | wd17xx_dden_w(device, BIT(data, 1)); |
| 612 | 656 | } |
| 613 | 657 | |
| 614 | 658 | /* Memory Maps */ |
| r9076 | r9077 | |
| 638 | 682 | |
| 639 | 683 | static ADDRESS_MAP_START( fast_io_map, ADDRESS_SPACE_IO, 8 ) |
| 640 | 684 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 641 | | AM_RANGE(0x00, 0x00) AM_MIRROR(0x0f) AM_DEVREAD(SAB1793_TAG, fast_data_r) |
| 642 | | AM_RANGE(0x10, 0x10) AM_MIRROR(0x0f) AM_DEVWRITE(SAB1793_TAG, fast_data_w) |
| 643 | | AM_RANGE(0x20, 0x20) AM_MIRROR(0x0f) AM_DEVWRITE(SAB1793_TAG, fast_status_w) |
| 644 | | AM_RANGE(0x30, 0x30) AM_MIRROR(0x0f) AM_DEVWRITE(SAB1793_TAG, fast_fdc_ctrl_w) |
| 645 | | AM_RANGE(0x40, 0x40) AM_MIRROR(0x0f) AM_DEVWRITE(SAB1793_TAG, fast_other_w) |
| 685 | AM_RANGE(0x00, 0x00) AM_MIRROR(0x0f) AM_DEVREAD(SAB1793_TAG, fast_3d_r) |
| 686 | AM_RANGE(0x10, 0x10) AM_MIRROR(0x0f) AM_DEVWRITE(SAB1793_TAG, fast_4d_w) |
| 687 | AM_RANGE(0x20, 0x20) AM_MIRROR(0x0f) AM_DEVWRITE(SAB1793_TAG, fast_4b_w) |
| 688 | AM_RANGE(0x30, 0x30) AM_MIRROR(0x0f) AM_DEVWRITE(SAB1793_TAG, fast_9b_w) |
| 689 | AM_RANGE(0x40, 0x40) AM_MIRROR(0x0f) AM_DEVWRITE(SAB1793_TAG, fast_8a_w) |
| 646 | 690 | AM_RANGE(0x50, 0x50) AM_MIRROR(0x0f) AM_READ_PORT("SW1") |
| 647 | 691 | AM_RANGE(0x60, 0x63) AM_MIRROR(0x0c) AM_DEVREAD(SAB1793_TAG, wd17xx_r) |
| 648 | 692 | AM_RANGE(0x70, 0x73) AM_MIRROR(0x0c) AM_DEVWRITE(SAB1793_TAG, wd17xx_w) |
| r9076 | r9077 | |
| 917 | 961 | { |
| 918 | 962 | fast_t *conkort = get_safe_token_fast(device->owner()); |
| 919 | 963 | |
| 920 | | //if (INTRQ enabled) |
| 921 | | { |
| 922 | | cpu_set_input_line(conkort->cpu, INPUT_LINE_NMI, state); |
| 923 | | } |
| 964 | cpu_set_input_line(conkort->cpu, INPUT_LINE_IRQ0, state); |
| 924 | 965 | } |
| 925 | 966 | |
| 926 | 967 | static const wd17xx_interface fast_wd17xx_interface = |
| r9076 | r9077 | |
| 1114 | 1155 | /* register for state saving */ |
| 1115 | 1156 | state_save_register_device_item(device, 0, conkort->cs); |
| 1116 | 1157 | state_save_register_device_item(device, 0, conkort->status); |
| 1117 | | state_save_register_device_item(device, 0, conkort->data); |
| 1158 | state_save_register_device_item(device, 0, conkort->data_in); |
| 1159 | state_save_register_device_item(device, 0, conkort->data_out); |
| 1118 | 1160 | state_save_register_device_item(device, 0, conkort->fdc_irq); |
| 1119 | 1161 | } |
| 1120 | 1162 | |
src/mess/machine/conkort.h
| r9076 | r9077 | |
| 20 | 20 | #define LUXOR_55_10828_ABCBUS(_tag) \ |
| 21 | 21 | _tag, DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_cs_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_stat_r), \ |
| 22 | 22 | DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_inp_r), DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_utp_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_c1_w), \ |
| 23 | | DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_c3_w), DEVCB_DEVICE_LINE(_tag, luxor_55_10828_rst_w) |
| 23 | DEVCB_NULL, DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_c3_w), DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, luxor_55_10828_rst_w) |
| 24 | 24 | |
| 25 | 25 | #define LUXOR_55_21046_ABCBUS(_tag) \ |
| 26 | 26 | _tag, DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_cs_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_stat_r), \ |
| 27 | 27 | DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_inp_r), DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_utp_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_c1_w), \ |
| 28 | | DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_c3_w), DEVCB_DEVICE_LINE(_tag, luxor_55_21046_rst_w) |
| 28 | DEVCB_NULL, DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_c3_w), DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, luxor_55_21046_rst_w) |
| 29 | 29 | |
| 30 | 30 | /*************************************************************************** |
| 31 | 31 | PROTOTYPES |