trunk/src/mame/drivers/fidelz80.cpp
| r250216 | r250217 | |
| 10 | 10 | * TODO: |
| 11 | 11 | * * Figure out why it says the first speech line twice; it shouldn't? |
| 12 | 12 | * It sometimes does this on Voice Sensory Chess Challenger real hardware. |
| 13 | | * It can also be heard on Advanced Talking Chess Challenger real hardware, cold boot. |
| 13 | * It can also be heard on Advanced Talking Chess Challenger real hardware, but not the whole line: |
| 14 | * "I I am Fidelity's chess challenger", instead. |
| 14 | 15 | * * Get rom locations from pcb (done for UVC, VCC is probably similar) |
| 15 | 16 | * * correctly hook up 7002/VBRC and 7014/bridgec3 speech so that the z80 is halted while words are being spoken |
| 16 | 17 | * |
| r250216 | r250217 | |
| 51 | 52 | |
| 52 | 53 | I/O map: |
| 53 | 54 | -------- |
| 54 | | 00-FF: 8255 port chip [LN edit: 00-03, mirrored over the 00-FF range; program accesses F4-F7] |
| 55 | 00-03: 8255 port chip, mirrored over the 00-FF range; program accesses F4-F7 |
| 55 | 56 | |
| 56 | 57 | |
| 57 | 58 | 8255 connections: |
| r250216 | r250217 | |
| 607 | 608 | void fidelz80_state::update_display() |
| 608 | 609 | { |
| 609 | 610 | // data for the 4x 7seg leds, bits are 0bxABCDEFG |
| 610 | | UINT8 out_digit = BITSWAP8( m_digit_data,7,0,1,2,3,4,5,6 ) & 0x7f; |
| 611 | UINT8 out_digit = BITSWAP8(m_digit_data,7,0,1,2,3,4,5,6) & 0x7f; |
| 611 | 612 | |
| 612 | 613 | if (m_led_selected&0x04) |
| 613 | 614 | { |
| 614 | 615 | output_set_digit_value(0, out_digit); |
| 615 | 616 | |
| 616 | | output_set_led_value(1, m_led_data & 0x01); |
| 617 | output_set_led_value(1, m_led_data); |
| 617 | 618 | } |
| 618 | 619 | if (m_led_selected&0x08) |
| 619 | 620 | { |
| 620 | 621 | output_set_digit_value(1, out_digit); |
| 621 | 622 | |
| 622 | | output_set_led_value(0, m_led_data & 0x01); |
| 623 | output_set_led_value(0, m_led_data); |
| 623 | 624 | } |
| 624 | 625 | if (m_led_selected&0x10) |
| 625 | 626 | { |
| r250216 | r250217 | |
| 631 | 632 | } |
| 632 | 633 | } |
| 633 | 634 | |
| 634 | | READ8_MEMBER( fidelz80_state::fidelz80_portc_r ) |
| 635 | READ8_MEMBER(fidelz80_state::fidelz80_portc_r) |
| 635 | 636 | { |
| 636 | 637 | UINT8 data = 0xff; |
| 637 | 638 | |
| r250216 | r250217 | |
| 655 | 656 | return data; |
| 656 | 657 | } |
| 657 | 658 | |
| 658 | | WRITE8_MEMBER( fidelz80_state::fidelz80_portb_w ) |
| 659 | WRITE8_MEMBER(fidelz80_state::fidelz80_portb_w) |
| 659 | 660 | { |
| 660 | 661 | if (!(data & 0x80)) |
| 661 | 662 | { |
| 662 | | m_led_data = (data&0x01); // common for two leds |
| 663 | m_led_data = data & 1; // common for two leds |
| 663 | 664 | |
| 664 | 665 | m_led_selected = data; |
| 665 | 666 | |
| r250216 | r250217 | |
| 669 | 670 | // ignoring the language switch enable for now, is bit 0x40 |
| 670 | 671 | } |
| 671 | 672 | |
| 672 | | WRITE8_MEMBER( fidelz80_state::fidelz80_portc_w ) |
| 673 | WRITE8_MEMBER(fidelz80_state::fidelz80_portc_w) |
| 673 | 674 | { |
| 674 | 675 | m_kp_matrix = data; |
| 675 | 676 | } |
| 676 | 677 | |
| 677 | | WRITE8_MEMBER( fidelz80_state::cc10_porta_w ) |
| 678 | WRITE8_MEMBER(fidelz80_state::cc10_porta_w) |
| 678 | 679 | { |
| 679 | 680 | m_beep->set_state((data & 0x80) ? 0 : 1); |
| 680 | 681 | |
| r250216 | r250217 | |
| 683 | 684 | update_display(); |
| 684 | 685 | } |
| 685 | 686 | |
| 686 | | READ8_MEMBER( fidelz80_state::vcc_portb_r ) |
| 687 | READ8_MEMBER(fidelz80_state::vcc_portb_r) |
| 687 | 688 | { |
| 688 | 689 | return (m_speech->bsy_r() != 0) ? 0x80 : 0x00; |
| 689 | 690 | } |
| 690 | 691 | |
| 691 | | WRITE8_MEMBER( fidelz80_state::vcc_porta_w ) |
| 692 | WRITE8_MEMBER(fidelz80_state::vcc_porta_w) |
| 692 | 693 | { |
| 693 | 694 | m_speech->set_volume(15); // hack, s14001a core should assume a volume of 15 unless otherwise stated... |
| 694 | 695 | m_speech->reg_w(data & 0x3f); |
| r250216 | r250217 | |
| 703 | 704 | I8255 Device, for VSC |
| 704 | 705 | ******************************************************************************/ |
| 705 | 706 | |
| 706 | | WRITE8_MEMBER( fidelz80_state::vsc_porta_w ) |
| 707 | WRITE8_MEMBER(fidelz80_state::vsc_porta_w) |
| 707 | 708 | { |
| 708 | | UINT8 out_digit = BITSWAP8( data,7,6,2,1,0,5,4,3 ); |
| 709 | UINT8 out_digit = BITSWAP8(data,7,6,2,1,0,5,4,3); |
| 709 | 710 | |
| 710 | 711 | if (m_kp_matrix & 0x01) |
| 711 | 712 | { |
| r250216 | r250217 | |
| 730 | 731 | m_speech->reg_w(data & 0x3f); |
| 731 | 732 | } |
| 732 | 733 | |
| 733 | | WRITE8_MEMBER( fidelz80_state::vsc_portb_w ) |
| 734 | WRITE8_MEMBER(fidelz80_state::vsc_portb_w) |
| 734 | 735 | { |
| 735 | | for (int row=1; row<=8; row++) |
| 736 | for (int row = 1; row <= 8; row++) |
| 736 | 737 | { |
| 737 | 738 | if (m_kp_matrix & 0x01) |
| 738 | 739 | output_set_indexed_value("led_a", row, BIT(data, 8-row)); |
| r250216 | r250217 | |
| 753 | 754 | } |
| 754 | 755 | } |
| 755 | 756 | |
| 756 | | WRITE8_MEMBER( fidelz80_state::vsc_portc_w ) |
| 757 | WRITE8_MEMBER(fidelz80_state::vsc_portc_w) |
| 757 | 758 | { |
| 758 | 759 | m_kp_matrix = (m_kp_matrix & 0x300) | data; |
| 759 | 760 | } |
| r250216 | r250217 | |
| 762 | 763 | PIO Device, for VSC |
| 763 | 764 | ******************************************************************************/ |
| 764 | 765 | |
| 765 | | READ8_MEMBER( fidelz80_state::vsc_pio_porta_r ) |
| 766 | READ8_MEMBER(fidelz80_state::vsc_pio_porta_r) |
| 766 | 767 | { |
| 767 | 768 | UINT8 data = 0; |
| 768 | 769 | |
| r250216 | r250217 | |
| 790 | 791 | return data & 0xff; |
| 791 | 792 | } |
| 792 | 793 | |
| 793 | | READ8_MEMBER( fidelz80_state::vsc_pio_portb_r ) |
| 794 | READ8_MEMBER(fidelz80_state::vsc_pio_portb_r) |
| 794 | 795 | { |
| 795 | 796 | UINT8 data = 0x00; |
| 796 | 797 | |
| r250216 | r250217 | |
| 800 | 801 | return data; |
| 801 | 802 | } |
| 802 | 803 | |
| 803 | | WRITE8_MEMBER( fidelz80_state::vsc_pio_portb_w ) |
| 804 | WRITE8_MEMBER(fidelz80_state::vsc_pio_portb_w) |
| 804 | 805 | { |
| 805 | 806 | m_kp_matrix = (m_kp_matrix & 0xff) | ((data & 0x03)<<8); |
| 806 | 807 | |
| r250216 | r250217 | |
| 957 | 958 | return m_i8041->upi41_master_r(space, 1); |
| 958 | 959 | } |
| 959 | 960 | |
| 960 | | WRITE8_MEMBER( fidelz80_state::bridgec_speech_w ) |
| 961 | WRITE8_MEMBER(fidelz80_state::bridgec_speech_w) |
| 961 | 962 | { |
| 962 | 963 | // todo: HALT THE z80 here, and set up a callback to poll the s14001a DONE line to resume z80 |
| 963 | 964 | m_speech->set_volume(15); // hack, s14001a core should assume a volume of 15 unless otherwise stated... |
| r250216 | r250217 | |
| 965 | 966 | m_speech->rst_w(BIT(data, 7)); |
| 966 | 967 | } |
| 967 | 968 | |
| 968 | | void fidelz80_state::machine_reset() |
| 969 | void fidelz80_state::machine_start() |
| 969 | 970 | { |
| 971 | // zerofill |
| 970 | 972 | m_led_selected = 0; |
| 971 | 973 | m_kp_matrix = 0; |
| 972 | 974 | m_digit_data = 0; |
| 973 | 975 | m_led_data = 0; |
| 974 | 976 | memset(m_digit_line_status, 0, sizeof(m_digit_line_status)); |
| 977 | |
| 978 | // register for savestates |
| 979 | save_item(NAME(m_led_selected)); |
| 980 | save_item(NAME(m_kp_matrix)); |
| 981 | save_item(NAME(m_digit_data)); |
| 982 | save_item(NAME(m_led_data)); |
| 983 | save_item(NAME(m_digit_line_status)); |
| 975 | 984 | } |
| 976 | 985 | |
| 977 | 986 | TIMER_DEVICE_CALLBACK_MEMBER(fidelz80_state::nmi_timer) |
| r250216 | r250217 | |
| 1011 | 1020 | AM_RANGE(0x2000, 0x3fff) AM_ROM // 8k rom |
| 1012 | 1021 | AM_RANGE(0x4000, 0x5fff) AM_ROM // 8k rom |
| 1013 | 1022 | AM_RANGE(0x6000, 0x63ff) AM_RAM AM_MIRROR(0x1c00) // 1k ram (2114*2) mirrored 8 times |
| 1014 | | AM_RANGE(0xE000, 0xE000) AM_WRITE(bridgec_speech_w) AM_MIRROR(0x1FFF) // write to speech chip, halts cpu |
| 1023 | AM_RANGE(0xe000, 0xe000) AM_WRITE(bridgec_speech_w) AM_MIRROR(0x1fff) // write to speech chip, halts cpu |
| 1015 | 1024 | ADDRESS_MAP_END |
| 1016 | 1025 | |
| 1017 | 1026 | static ADDRESS_MAP_START(fidel_z80_io, AS_IO, 8, fidelz80_state) |
| r250216 | r250217 | |
| 1061 | 1070 | } |
| 1062 | 1071 | |
| 1063 | 1072 | static INPUT_PORTS_START( fidelz80 ) |
| 1064 | | PORT_START("LEVEL") // cc10 only |
| 1073 | PORT_START("LEVEL") // cc10 only |
| 1065 | 1074 | PORT_CONFNAME( 0x80, 0x00, "Number of levels" ) |
| 1066 | 1075 | PORT_CONFSETTING( 0x00, "10" ) |
| 1067 | 1076 | PORT_CONFSETTING( 0x80, "3" ) |
| r250216 | r250217 | |
| 1250 | 1259 | ******************************************************************************/ |
| 1251 | 1260 | |
| 1252 | 1261 | static MACHINE_CONFIG_START( cc10, fidelz80_state ) |
| 1262 | |
| 1253 | 1263 | /* basic machine hardware */ |
| 1254 | 1264 | MCFG_CPU_ADD("maincpu", Z80, XTAL_4MHz) |
| 1255 | 1265 | MCFG_CPU_PROGRAM_MAP(cc10_z80_mem) |
| r250216 | r250217 | |
| 1268 | 1278 | MCFG_I8255_OUT_PORTC_CB(WRITE8(fidelz80_state, fidelz80_portc_w)) |
| 1269 | 1279 | |
| 1270 | 1280 | /* sound hardware */ |
| 1271 | | MCFG_SPEAKER_STANDARD_MONO( "mono" ) |
| 1272 | | MCFG_SOUND_ADD( "beeper", BEEP, 0 ) |
| 1273 | | MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.00 ) |
| 1281 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1282 | MCFG_SOUND_ADD("beeper", BEEP, 0) |
| 1283 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 1274 | 1284 | MACHINE_CONFIG_END |
| 1275 | 1285 | |
| 1276 | 1286 | static MACHINE_CONFIG_START( vcc, fidelz80_state ) |
| 1287 | |
| 1277 | 1288 | /* basic machine hardware */ |
| 1278 | 1289 | MCFG_CPU_ADD("maincpu", Z80, XTAL_4MHz) |
| 1279 | 1290 | MCFG_CPU_PROGRAM_MAP(vcc_z80_mem) |
| r250216 | r250217 | |
| 1299 | 1310 | MACHINE_CONFIG_END |
| 1300 | 1311 | |
| 1301 | 1312 | static MACHINE_CONFIG_START( vsc, fidelz80_state ) |
| 1313 | |
| 1302 | 1314 | /* basic machine hardware */ |
| 1303 | 1315 | MCFG_CPU_ADD("maincpu", Z80, XTAL_4MHz) |
| 1304 | 1316 | MCFG_CPU_PROGRAM_MAP(vsc_mem) |
| r250216 | r250217 | |
| 1327 | 1339 | MACHINE_CONFIG_END |
| 1328 | 1340 | |
| 1329 | 1341 | static MACHINE_CONFIG_START( bridgec, fidelz80_state ) |
| 1342 | |
| 1330 | 1343 | /* basic machine hardware */ |
| 1331 | 1344 | MCFG_CPU_ADD("maincpu", Z80, XTAL_5MHz/2) // 2.5MHz |
| 1332 | 1345 | MCFG_CPU_PROGRAM_MAP(bridgec_z80_mem) |
| r250216 | r250217 | |
| 1343 | 1356 | MCFG_I8243_ADD("i8243", NOOP, WRITE8(fidelz80_state,digit_w)) |
| 1344 | 1357 | |
| 1345 | 1358 | /* sound hardware */ |
| 1346 | | MCFG_SPEAKER_STANDARD_MONO( "mono" ) |
| 1359 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1347 | 1360 | MCFG_SOUND_ADD("speech", S14001A, 25000) // around 25khz |
| 1348 | | MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.00 ) |
| 1361 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 1349 | 1362 | MACHINE_CONFIG_END |
| 1350 | 1363 | |
| 1351 | 1364 | |
| r250216 | r250217 | |
| 1419 | 1432 | Drivers |
| 1420 | 1433 | ******************************************************************************/ |
| 1421 | 1434 | |
| 1422 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 1423 | | COMP( 1978, cc10, 0, 0, cc10, fidelz80, driver_device, 0, "Fidelity Electronics", "Chess Challenger 10 (Model CC10/BCC)", MACHINE_NOT_WORKING ) |
| 1424 | | COMP( 1979, vcc, 0, 0, vcc, fidelz80, driver_device, 0, "Fidelity Electronics", "Talking Chess Challenger (model VCC)", MACHINE_NOT_WORKING ) |
| 1425 | | COMP( 1979, vbrc, 0, 0, bridgec, bridgec, driver_device, 0, "Fidelity Electronics", "Bridge Challenger (model VBRC/7002)", MACHINE_NOT_WORKING ) |
| 1426 | | COMP( 1980, uvc, vcc, 0, vcc, fidelz80, driver_device, 0, "Fidelity Electronics", "Advanced Talking Chess Challenger (model UVC)", MACHINE_NOT_WORKING ) |
| 1427 | | COMP( 1980, bridgec3, vbrc, 0, bridgec, bridgec, driver_device, 0, "Fidelity Electronics", "Bridge Challenger 3 (model 7014)", MACHINE_NOT_WORKING ) |
| 1428 | | COMP( 1980, vsc, 0, 0, vsc, vsc, driver_device, 0, "Fidelity Electronics", "Voice Sensory Chess Challenger (model VSC)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK ) |
| 1435 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */ |
| 1436 | COMP( 1978, cc10, 0, 0, cc10, fidelz80, driver_device, 0, "Fidelity Electronics", "Chess Challenger 10 (Model CC10/BCC)", MACHINE_NOT_WORKING ) |
| 1437 | COMP( 1979, vcc, 0, 0, vcc, fidelz80, driver_device, 0, "Fidelity Electronics", "Talking Chess Challenger (model VCC)", MACHINE_NOT_WORKING ) |
| 1438 | COMP( 1979, vbrc, 0, 0, bridgec, bridgec, driver_device, 0, "Fidelity Electronics", "Bridge Challenger (model VBRC/7002)", MACHINE_NOT_WORKING ) |
| 1439 | COMP( 1980, uvc, vcc, 0, vcc, fidelz80, driver_device, 0, "Fidelity Electronics", "Advanced Talking Chess Challenger (model UVC)", MACHINE_NOT_WORKING ) |
| 1440 | COMP( 1980, bridgec3, vbrc, 0, bridgec, bridgec, driver_device, 0, "Fidelity Electronics", "Bridge Challenger 3 (model 7014)", MACHINE_NOT_WORKING ) |
| 1441 | COMP( 1980, vsc, 0, 0, vsc, vsc, driver_device, 0, "Fidelity Electronics", "Voice Sensory Chess Challenger (model VSC)", MACHINE_NOT_WORKING | MACHINE_CLICKABLE_ARTWORK ) |
trunk/src/mame/includes/fidelz80.h
| r250216 | r250217 | |
| 2 | 2 | // copyright-holders:Kevin Horton,Jonathan Gevaryahu,Sandro Ronco |
| 3 | 3 | /*************************************************************************** |
| 4 | 4 | |
| 5 | | fidelz80.h |
| 5 | Fidelity Electronics Z80 based board driver |
| 6 | 6 | |
| 7 | 7 | ****************************************************************************/ |
| 8 | 8 | |
| r250216 | r250217 | |
| 19 | 19 | public: |
| 20 | 20 | fidelz80_state(const machine_config &mconfig, device_type type, const char *tag) |
| 21 | 21 | : driver_device(mconfig, type, tag), |
| 22 | | m_maincpu(*this, "maincpu"), |
| 23 | | m_speech(*this, "speech"), |
| 24 | | m_beep(*this, "beeper"), |
| 25 | | m_i8041(*this, "mcu"), |
| 26 | | m_i8243(*this, "i8243") |
| 27 | | { } |
| 22 | m_maincpu(*this, "maincpu"), |
| 23 | m_speech(*this, "speech"), |
| 24 | m_beep(*this, "beeper"), |
| 25 | m_i8041(*this, "mcu"), |
| 26 | m_i8243(*this, "i8243") |
| 27 | { } |
| 28 | 28 | |
| 29 | 29 | required_device<cpu_device> m_maincpu; |
| 30 | 30 | optional_device<s14001a_device> m_speech; |
| r250216 | r250217 | |
| 32 | 32 | optional_device<i8041_device> m_i8041; |
| 33 | 33 | optional_device<i8243_device> m_i8243; |
| 34 | 34 | |
| 35 | | UINT16 m_kp_matrix; // keypad/leds matrix |
| 36 | | UINT8 m_led_data; // data for the two individual leds, in 0bxxxx12xx format |
| 37 | | UINT8 m_led_selected; // 5 bit selects for 7 seg leds and for common other leds, bits are (7seg leds are 0 1 2 3, common other leds are C) 0bxx3210xc |
| 38 | | UINT16 m_digit_data; // data for seg leds |
| 35 | UINT16 m_kp_matrix; // keypad/leds matrix |
| 36 | UINT8 m_led_data; // data for the two individual leds, in 0bxxxx12xx format |
| 37 | UINT8 m_led_selected; // 5 bit selects for 7 seg leds and for common other leds, bits are (7seg leds are 0 1 2 3, common other leds are C) 0bxx3210xc |
| 38 | UINT16 m_digit_data; // data for seg leds |
| 39 | 39 | UINT8 m_digit_line_status[4]; // prevent overwrite of m_digit_data |
| 40 | 40 | |
| 41 | | virtual void machine_reset(); |
| 42 | | |
| 43 | 41 | //model VCC/UVC |
| 44 | 42 | void update_display(); |
| 45 | | DECLARE_READ8_MEMBER( fidelz80_portc_r ); |
| 46 | | DECLARE_WRITE8_MEMBER( fidelz80_portb_w ); |
| 47 | | DECLARE_WRITE8_MEMBER( fidelz80_portc_w ); |
| 48 | | DECLARE_WRITE8_MEMBER( cc10_porta_w ); |
| 49 | | DECLARE_READ8_MEMBER( vcc_portb_r ); |
| 50 | | DECLARE_WRITE8_MEMBER( vcc_porta_w ); |
| 43 | DECLARE_READ8_MEMBER(fidelz80_portc_r); |
| 44 | DECLARE_WRITE8_MEMBER(fidelz80_portb_w); |
| 45 | DECLARE_WRITE8_MEMBER(fidelz80_portc_w); |
| 46 | DECLARE_WRITE8_MEMBER(cc10_porta_w); |
| 47 | DECLARE_READ8_MEMBER(vcc_portb_r); |
| 48 | DECLARE_WRITE8_MEMBER(vcc_porta_w); |
| 51 | 49 | |
| 52 | 50 | //model 7014 and VBC |
| 53 | | DECLARE_WRITE8_MEMBER(bridgec_speech_w ); |
| 51 | DECLARE_WRITE8_MEMBER(bridgec_speech_w); |
| 54 | 52 | DECLARE_WRITE8_MEMBER(kp_matrix_w); |
| 55 | 53 | DECLARE_READ8_MEMBER(unknown_r); |
| 56 | 54 | DECLARE_READ8_MEMBER(unknown2_r); |
| r250216 | r250217 | |
| 73 | 71 | TIMER_DEVICE_CALLBACK_MEMBER(nmi_timer); |
| 74 | 72 | |
| 75 | 73 | DECLARE_WRITE8_MEMBER(digit_w); |
| 74 | |
| 75 | virtual void machine_start(); |
| 76 | 76 | }; |
| 77 | 77 | |
| 78 | 78 | |