src/mess/machine/c16.c
| r6702 | r6703 | |
| 15 | 15 | |
| 16 | 16 | #include "machine/6525tpi.h" |
| 17 | 17 | #include "video/ted7360.h" |
| 18 | | #include "includes/cbmserb.h" |
| 18 | #include "machine/cbmiec.h" |
| 19 | 19 | #include "includes/vc1541.h" |
| 20 | 20 | #include "includes/cbmdrive.h" |
| 21 | 21 | |
| r6702 | r6703 | |
| 113 | 113 | |
| 114 | 114 | void c16_m7501_port_write( const device_config *device, UINT8 direction, UINT8 data ) |
| 115 | 115 | { |
| 116 | | const device_config *serbus = devtag_get_device(device->machine, "serial_bus"); |
| 117 | | int dat, atn, clk; |
| 116 | const device_config *serbus = devtag_get_device(device->machine, "iec"); |
| 118 | 117 | |
| 119 | 118 | /* bit zero then output 0 */ |
| 120 | | cbm_serial_atn_write(serbus, 0, atn = !(data & 0x04)); |
| 121 | | cbm_serial_clock_write(serbus, 0, clk = !(data & 0x02)); |
| 122 | | cbm_serial_data_write(serbus, 0, dat = !(data & 0x01)); |
| 119 | cbm_iec_atn_w(serbus, device, !(data & 0x04)); |
| 120 | cbm_iec_clk_w(serbus, device, !(data & 0x02)); |
| 121 | cbm_iec_data_w(serbus, device, !(data & 0x01)); |
| 123 | 122 | |
| 124 | 123 | cassette_output(devtag_get_device(device->machine, "cassette"), !(data & 0x02) ? -(0x5a9e >> 1) : +(0x5a9e >> 1)); |
| 125 | 124 | |
| r6702 | r6703 | |
| 130 | 129 | { |
| 131 | 130 | UINT8 data = 0xff; |
| 132 | 131 | UINT8 c16_port7501 = (UINT8) devtag_get_info_int(device->machine, "maincpu", CPUINFO_INT_M6510_PORT); |
| 133 | | const device_config *serbus = devtag_get_device(device->machine, "serial_bus"); |
| 132 | const device_config *serbus = devtag_get_device(device->machine, "iec"); |
| 134 | 133 | |
| 135 | | if ((c16_port7501 & 0x01) || !cbm_serial_data_read(serbus, 0)) |
| 134 | if ((c16_port7501 & 0x01) || !cbm_iec_data_r(serbus)) |
| 136 | 135 | data &= ~0x80; |
| 137 | 136 | |
| 138 | | if ((c16_port7501 & 0x02) || !cbm_serial_clock_read(serbus, 0)) |
| 137 | if ((c16_port7501 & 0x02) || !cbm_iec_clk_r(serbus)) |
| 139 | 138 | data &= ~0x40; |
| 140 | 139 | |
| 141 | 140 | // data &= ~0x20; // port bit not in pinout |
src/mess/drivers/c16.c
| r6702 | r6703 | |
| 126 | 126 | #include "machine/cbmipt.h" |
| 127 | 127 | #include "video/ted7360.h" |
| 128 | 128 | #include "devices/messram.h" |
| 129 | #include "machine/c1541.h" |
| 130 | #include "machine/c1551.h" |
| 129 | 131 | |
| 130 | 132 | /* devices config */ |
| 131 | 133 | #include "includes/cbm.h" |
| 132 | 134 | #include "includes/cbmdrive.h" |
| 133 | | #include "includes/cbmserb.h" |
| 135 | #include "machine/cbmiec.h" |
| 134 | 136 | |
| 135 | 137 | #include "includes/c16.h" |
| 136 | 138 | |
| r6702 | r6703 | |
| 412 | 414 | c16_m7501_port_write /* port_write_func */ |
| 413 | 415 | }; |
| 414 | 416 | |
| 417 | static CBM_IEC_DAISY( c16_iec_no_drives ) |
| 418 | { |
| 419 | { "maincpu" }, |
| 420 | { NULL} |
| 421 | }; |
| 422 | |
| 423 | static CBM_IEC_DAISY( c16_iec_1541 ) |
| 424 | { |
| 425 | { "maincpu" }, |
| 426 | { C1541_IEC("c1541") }, |
| 427 | { NULL} |
| 428 | }; |
| 429 | |
| 415 | 430 | static MACHINE_DRIVER_START( c16 ) |
| 416 | 431 | /* basic machine hardware */ |
| 417 | 432 | MDRV_CPU_ADD("maincpu", M7501, 1400000) /* 7.8336 MHz */ |
| r6702 | r6703 | |
| 449 | 464 | /* cassette */ |
| 450 | 465 | MDRV_CASSETTE_ADD( "cassette", cbm_cassette_config ) |
| 451 | 466 | |
| 452 | | /* floppy from serial bus */ |
| 453 | | MDRV_IMPORT_FROM(simulated_drive) |
| 454 | | |
| 455 | 467 | /* tpi */ |
| 456 | 468 | MDRV_TPI6525_ADD("tpi6535_tpi_2", c16_tpi6525_tpi_2_intf) |
| 457 | 469 | MDRV_TPI6525_ADD("tpi6535_tpi_3", c16_tpi6525_tpi_3_intf) |
| 458 | 470 | |
| 459 | 471 | MDRV_IMPORT_FROM(c16_cartslot) |
| 460 | 472 | |
| 473 | /* IEC serial bus */ |
| 474 | MDRV_CBM_IEC_ADD("iec", c16_iec_no_drives) |
| 475 | |
| 461 | 476 | /* internal ram */ |
| 462 | 477 | MDRV_RAM_ADD("messram") |
| 463 | 478 | MDRV_RAM_DEFAULT_SIZE("64K") |
| r6702 | r6703 | |
| 476 | 491 | /* emulation code currently supports only one drive */ |
| 477 | 492 | MDRV_DEVICE_REMOVE("tpi6535_tpi_3") |
| 478 | 493 | |
| 479 | | MDRV_DEVICE_REMOVE("serial_bus") // in the current code, serial bus device is tied to the floppy drive |
| 480 | 494 | MDRV_IMPORT_FROM( cpu_c1551 ) |
| 481 | 495 | #ifdef CPU_SYNC |
| 482 | 496 | MDRV_QUANTUM_TIME(HZ(60)) |
| r6702 | r6703 | |
| 489 | 503 | static MACHINE_DRIVER_START( c16v ) |
| 490 | 504 | MDRV_IMPORT_FROM( c16 ) |
| 491 | 505 | |
| 492 | | MDRV_DEVICE_REMOVE("serial_bus") // in the current code, serial bus device is tied to the floppy drive |
| 493 | | MDRV_IMPORT_FROM( cpu_vc1541 ) |
| 506 | /* floppy from serial bus */ |
| 507 | MDRV_DEVICE_REMOVE("iec") |
| 508 | MDRV_CBM_IEC_ADD("iec", c16_iec_1541) |
| 509 | MDRV_C1541_ADD("c1541", "iec", 8) |
| 494 | 510 | #ifdef CPU_SYNC |
| 495 | 511 | MDRV_QUANTUM_TIME(HZ(60)) |
| 496 | 512 | #else |
| r6702 | r6703 | |
| 528 | 544 | MDRV_TPI6525_ADD("tpi6535_tpi_2", c16_tpi6525_tpi_2_c1551_intf) |
| 529 | 545 | |
| 530 | 546 | /* emulation code currently supports only one drive */ |
| 531 | | MDRV_DEVICE_REMOVE("serial_bus") // in the current code, serial bus device is tied to the floppy drive |
| 532 | 547 | MDRV_DEVICE_REMOVE("tpi6535_tpi_3") |
| 533 | 548 | |
| 534 | 549 | MDRV_IMPORT_FROM( cpu_c1551 ) |
| r6702 | r6703 | |
| 546 | 561 | static MACHINE_DRIVER_START( plus4v ) |
| 547 | 562 | MDRV_IMPORT_FROM( plus4 ) |
| 548 | 563 | |
| 549 | | MDRV_DEVICE_REMOVE("serial_bus") // in the current code, serial bus device is tied to the floppy drive |
| 550 | | MDRV_IMPORT_FROM( cpu_vc1541 ) |
| 564 | /* floppy from serial bus */ |
| 565 | MDRV_DEVICE_REMOVE("iec") |
| 566 | MDRV_CBM_IEC_ADD("iec", c16_iec_1541) |
| 567 | MDRV_C1541_ADD("c1541", "iec", 8) |
| 551 | 568 | |
| 552 | 569 | MDRV_SCREEN_MODIFY("screen") |
| 553 | 570 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| r6702 | r6703 | |
| 636 | 653 | ROM_REGION( 0x40000, "maincpu", 0 ) |
| 637 | 654 | ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) ) |
| 638 | 655 | ROM_LOAD( "318004-05.bin", 0x14000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb) ) |
| 639 | | |
| 640 | | /* we temporarily use -bios to select among vc1541 firmwares, for this system */ |
| 641 | | VC1541_ROM("cpu_vc1540") |
| 642 | 656 | ROM_END |
| 643 | 657 | |
| 644 | 658 | #define rom_c116 rom_c16 |
| r6702 | r6703 | |
| 684 | 698 | |
| 685 | 699 | ROM_LOAD( "317053-01.bin", 0x18000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f) ) |
| 686 | 700 | ROM_LOAD( "317054-01.bin", 0x1c000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693) ) |
| 687 | | |
| 688 | | /* we temporarily use -bios to select among vc1541 firmwares, for this system */ |
| 689 | | VC1541_ROM("cpu_vc1540") |
| 690 | 701 | ROM_END |
| 691 | 702 | |
| 692 | 703 | |
| r6702 | r6703 | |
| 705 | 716 | CONFIG_DEVICE(c1551_device_getinfo) |
| 706 | 717 | SYSTEM_CONFIG_END |
| 707 | 718 | |
| 708 | | static SYSTEM_CONFIG_START(c16v) |
| 709 | | CONFIG_DEVICE(vc1541_device_getinfo) |
| 710 | | SYSTEM_CONFIG_END |
| 711 | | |
| 712 | 719 | static SYSTEM_CONFIG_START(plus) |
| 713 | 720 | CONFIG_DEVICE(cbmfloppy_device_getinfo) |
| 714 | 721 | SYSTEM_CONFIG_END |
| r6702 | r6703 | |
| 717 | 724 | CONFIG_DEVICE(c1551_device_getinfo) |
| 718 | 725 | SYSTEM_CONFIG_END |
| 719 | 726 | |
| 720 | | static SYSTEM_CONFIG_START(plusv) |
| 721 | | CONFIG_DEVICE(vc1541_device_getinfo) |
| 722 | | SYSTEM_CONFIG_END |
| 723 | 727 | |
| 724 | 728 | /*************************************************************************** |
| 725 | 729 | |
| r6702 | r6703 | |
| 731 | 735 | |
| 732 | 736 | COMP( 1984, c16, 0, 0, c16, c16, c16, c16, "Commodore Business Machines Co.", "Commodore 16 (PAL)", 0) |
| 733 | 737 | COMP( 1984, c16c, c16, 0, c16c, c16, c16c, c16c, "Commodore Business Machines Co.", "Commodore 16 (PAL, 1551)", 0 ) |
| 734 | | COMP( 1984, c16v, c16, 0, c16v, c16, c16v, c16v, "Commodore Business Machines Co.", "Commodore 16 (PAL, VC1541)", GAME_NOT_WORKING) |
| 738 | COMP( 1984, c16v, c16, 0, c16v, c16, c16v, 0, "Commodore Business Machines Co.", "Commodore 16 (PAL, VC1541)", GAME_NOT_WORKING) |
| 735 | 739 | COMP( 1984, c16hun, c16, 0, c16, c16, c16, c16, "Commodore Business Machines Co.", "Commodore 16 Novotrade (PAL, Hungary)", 0) |
| 736 | 740 | |
| 737 | 741 | COMP( 1984, c116, c16, 0, c16, c16, c16, c16, "Commodore Business Machines Co.", "Commodore 116 (PAL)", 0) |
| 738 | 742 | COMP( 1984, c116c, c16, 0, c16c, c16, c16c, c16c, "Commodore Business Machines Co.", "Commodore 116 (PAL, 1551)", 0 ) |
| 739 | | COMP( 1984, c116v, c16, 0, c16v, c16, c16v, c16v, "Commodore Business Machines Co.", "Commodore 116 (PAL, VC1541)", GAME_NOT_WORKING) |
| 743 | COMP( 1984, c116v, c16, 0, c16v, c16, c16v, 0, "Commodore Business Machines Co.", "Commodore 116 (PAL, VC1541)", GAME_NOT_WORKING) |
| 740 | 744 | |
| 741 | 745 | COMP( 1984, plus4, c16, 0, plus4, plus4, c16, plus, "Commodore Business Machines Co.", "Commodore Plus/4 (NTSC)", 0) |
| 742 | 746 | COMP( 1984, plus4c, c16, 0, plus4c, plus4, c16c, plusc, "Commodore Business Machines Co.", "Commodore Plus/4 (NTSC, 1551)", 0 ) |
| 743 | | COMP( 1984, plus4v, c16, 0, plus4v, plus4, c16v, plusv, "Commodore Business Machines Co.", "Commodore Plus/4 (NTSC, VC1541)", GAME_NOT_WORKING) |
| 747 | COMP( 1984, plus4v, c16, 0, plus4v, plus4, c16v, 0, "Commodore Business Machines Co.", "Commodore Plus/4 (NTSC, VC1541)", GAME_NOT_WORKING) |
| 744 | 748 | |
| 745 | 749 | COMP( 1984, c232, c16, 0, c16, c16, c16, c16, "Commodore Business Machines Co.", "Commodore 232 (Prototype)", 0) |
| 746 | 750 | COMP( 1984, c264, c16, 0, c264, plus4, c16, plus, "Commodore Business Machines Co.", "Commodore 264 (Prototype)", 0) |