src/mess/drivers/fidelz80.c
| r11545 | r11546 | |
| 8 | 8 | * TODO: |
| 9 | 9 | * * Figure out why it says the first speech line twice; it shouldn't. (It sometimes does this on the sensory chess challenger real hardware) |
| 10 | 10 | * * Get rom locations from pcb (done for UVC, VCC is probably similar) |
| 11 | | * * Add sensory chess challenger roms/memmap to driver, similar hardware. |
| 12 | 11 | * * correctly hook up VBC/ABC speech so that the z80 is halted while words are being spoken |
| 13 | 12 | * * VSC doesn't accept input from row 9 (the buttons beside the display) |
| 14 | 13 | * |
| r11545 | r11546 | |
| 427 | 426 | |
| 428 | 427 | |
| 429 | 428 | *********************************************************************** |
| 430 | | Sensory Chess Challenger (needs adding to driver) |
| 429 | Sensory Chess Challenger |
| 431 | 430 | ------------------------ |
| 432 | 431 | |
| 433 | 432 | The display/button/LED/speech technology is identical to the above product. |
| r11545 | r11546 | |
| 593 | 592 | /* Devices */ |
| 594 | 593 | |
| 595 | 594 | /****************************************************************************** |
| 596 | | I8255 Device |
| 595 | I8255 Device, for VCC/UVC |
| 597 | 596 | ******************************************************************************/ |
| 598 | 597 | |
| 599 | 598 | void fidelz80_state::update_display(running_machine &machine) |
| r11545 | r11546 | |
| 605 | 604 | { |
| 606 | 605 | output_set_digit_value(0, out_digit); |
| 607 | 606 | |
| 608 | | output_set_led_value(1, m_led_selected & 0x01); |
| 607 | output_set_led_value(1, m_led_data & 0x01); |
| 609 | 608 | } |
| 610 | 609 | if (m_led_selected&0x08) |
| 611 | 610 | { |
| 612 | 611 | output_set_digit_value(1, out_digit); |
| 613 | 612 | |
| 614 | | output_set_led_value(0, m_led_selected & 0x01); |
| 613 | output_set_led_value(0, m_led_data & 0x01); |
| 615 | 614 | } |
| 616 | 615 | if (m_led_selected&0x10) |
| 617 | 616 | { |
| r11545 | r11546 | |
| 627 | 626 | { |
| 628 | 627 | UINT8 data = 0xff; |
| 629 | 628 | |
| 630 | | switch (m_kp_matrix & 0xf0) |
| 629 | if (!(m_kp_matrix&0x10)) |
| 631 | 630 | { |
| 632 | | case 0xe0: |
| 633 | | data = input_port_read(machine(), "LINE1"); |
| 634 | | break; |
| 635 | | case 0xd0: |
| 636 | | data = input_port_read(machine(), "LINE2"); |
| 637 | | break; |
| 638 | | case 0xb0: |
| 639 | | data = input_port_read(machine(), "LINE3"); |
| 640 | | break; |
| 641 | | case 0x70: |
| 642 | | data = input_port_read(machine(), "LINE4"); |
| 643 | | break; |
| 631 | data &= input_port_read(machine(), "LINE1"); |
| 644 | 632 | } |
| 633 | if (!(m_kp_matrix&0x20)) |
| 634 | { |
| 635 | data &= input_port_read(machine(), "LINE2"); |
| 636 | } |
| 637 | if (!(m_kp_matrix&0x40)) |
| 638 | { |
| 639 | data &= input_port_read(machine(), "LINE3"); |
| 640 | } |
| 641 | if (!(m_kp_matrix&0x80)) |
| 642 | { |
| 643 | data &= input_port_read(machine(), "LINE4"); |
| 644 | } |
| 645 | 645 | |
| 646 | 646 | return data; |
| 647 | 647 | } |
| r11545 | r11546 | |
| 650 | 650 | { |
| 651 | 651 | if (!(data & 0x80)) |
| 652 | 652 | { |
| 653 | | if (data&0x1) // common for two leds |
| 654 | | m_led_data = (data&0xc); |
| 653 | m_led_data = (data&0x01); // common for two leds |
| 655 | 654 | |
| 656 | 655 | m_led_selected = data; |
| 657 | 656 | |
| r11545 | r11546 | |
| 677 | 676 | |
| 678 | 677 | READ8_MEMBER( fidelz80_state::vcc_portb_r ) |
| 679 | 678 | { |
| 680 | | if (s14001a_bsy_r(m_speech) != 0) |
| 681 | | return 0x80; |
| 682 | | else |
| 683 | | return 0x00; |
| 679 | return (s14001a_bsy_r(m_speech) != 0) ? 0x80 : 0x00; |
| 684 | 680 | } |
| 685 | 681 | |
| 686 | 682 | WRITE8_MEMBER( fidelz80_state::vcc_porta_w ) |
| 687 | 683 | { |
| 688 | 684 | s14001a_set_volume(m_speech, 15); // hack, s14001a core should assume a volume of 15 unless otherwise stated... |
| 689 | 685 | s14001a_reg_w(m_speech, data & 0x3f); |
| 690 | | s14001a_rst_w(m_speech, (data & 0x80)>>7); |
| 686 | s14001a_rst_w(m_speech, BIT(data, 7)); |
| 691 | 687 | |
| 692 | | if (!(data & 0x80)) |
| 693 | | { |
| 694 | | m_digit_data = data; |
| 688 | m_digit_data = data; |
| 695 | 689 | |
| 696 | | update_display(machine()); |
| 697 | | } |
| 690 | update_display(machine()); |
| 698 | 691 | } |
| 699 | 692 | |
| 700 | | WRITE8_MEMBER( fidelz80_state::abc_speech_w ) |
| 701 | | { |
| 702 | | // todo: HALT THE z80 here, and set up a callback to poll the s14001a DONE line to resume z80 |
| 703 | | s14001a_set_volume(m_speech, 15); // hack, s14001a core should assume a volume of 15 unless otherwise stated... |
| 704 | | s14001a_reg_w(m_speech, data & 0x3f); |
| 705 | | s14001a_rst_w(m_speech, (data & 0x80)>>7); |
| 706 | | } |
| 707 | | |
| 708 | 693 | static I8255_INTERFACE( cc10_ppi8255_intf ) |
| 709 | 694 | { |
| 710 | 695 | DEVCB_NULL, |
| r11545 | r11546 | |
| 781 | 766 | |
| 782 | 767 | WRITE8_MEMBER( fidelz80_state::vsc_portc_w ) |
| 783 | 768 | { |
| 784 | | m_kp_matrix = data; |
| 769 | m_kp_matrix = (m_kp_matrix & 0x100) | data; |
| 785 | 770 | } |
| 786 | 771 | |
| 787 | 772 | static I8255_INTERFACE( vsc_ppi8255_intf ) |
| r11545 | r11546 | |
| 1024 | 1009 | return upi41_master_r(m_i8041, 1); |
| 1025 | 1010 | } |
| 1026 | 1011 | |
| 1012 | WRITE8_MEMBER( fidelz80_state::abc_speech_w ) |
| 1013 | { |
| 1014 | // todo: HALT THE z80 here, and set up a callback to poll the s14001a DONE line to resume z80 |
| 1015 | s14001a_set_volume(m_speech, 15); // hack, s14001a core should assume a volume of 15 unless otherwise stated... |
| 1016 | s14001a_reg_w(m_speech, data & 0x3f); |
| 1017 | s14001a_rst_w(m_speech, BIT(data, 7)); |
| 1018 | } |
| 1019 | |
| 1027 | 1020 | void fidelz80_state::machine_reset() |
| 1028 | 1021 | { |
| 1029 | 1022 | m_led_selected = 0; |
| 1030 | 1023 | m_kp_matrix = 0; |
| 1031 | 1024 | m_digit_data = 0; |
| 1025 | m_led_data = 0; |
| 1032 | 1026 | memset(m_digit_line_status, 0, ARRAY_LENGTH(m_digit_line_status)); |
| 1033 | 1027 | } |
| 1034 | 1028 | |
| r11545 | r11546 | |
| 1131 | 1125 | PORT_START("LINE1") |
| 1132 | 1126 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("RE") PORT_CODE(KEYCODE_R) PORT_CHANGED(fidelz80_trigger_reset, 0) |
| 1133 | 1127 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("LV") PORT_CODE(KEYCODE_V) |
| 1134 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("A1") PORT_CODE(KEYCODE_1) |
| 1135 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("E5") PORT_CODE(KEYCODE_5) |
| 1128 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("A1") PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_A) |
| 1129 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("E5") PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_E) |
| 1136 | 1130 | |
| 1137 | 1131 | PORT_START("LINE2") |
| 1138 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("CB") PORT_CODE(KEYCODE_C) |
| 1139 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("DM") PORT_CODE(KEYCODE_D) |
| 1140 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("B2") PORT_CODE(KEYCODE_2) |
| 1141 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("F6") PORT_CODE(KEYCODE_6) |
| 1132 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("CB") PORT_CODE(KEYCODE_Z) |
| 1133 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("DM") PORT_CODE(KEYCODE_M) |
| 1134 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("B2") PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_B) |
| 1135 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("F6") PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_F) |
| 1142 | 1136 | |
| 1143 | 1137 | PORT_START("LINE3") |
| 1144 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_L) |
| 1145 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_B) |
| 1146 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("C3") PORT_CODE(KEYCODE_3) |
| 1147 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("G7") PORT_CODE(KEYCODE_7) |
| 1138 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_DEL) |
| 1139 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("PB") PORT_CODE(KEYCODE_P) |
| 1140 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("C3") PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_C) |
| 1141 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("G7") PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_G) |
| 1148 | 1142 | |
| 1149 | 1143 | PORT_START("LINE4") |
| 1150 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("EN") PORT_CODE(KEYCODE_E) |
| 1144 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("EN") PORT_CODE(KEYCODE_ENTER) |
| 1151 | 1145 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("PV") PORT_CODE(KEYCODE_O) |
| 1152 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("D4") PORT_CODE(KEYCODE_4) |
| 1153 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("H8") PORT_CODE(KEYCODE_8) |
| 1146 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("D4") PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_D) |
| 1147 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("H8") PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_H) |
| 1154 | 1148 | INPUT_PORTS_END |
| 1155 | 1149 | |
| 1156 | 1150 | static INPUT_PORTS_START( vsc ) |