Previous 15994 Revisions Next

r6703 Thursday 17th December, 2009 at 22:05:39 UTC by Curt Coder
[C16] Connected 1541 thru IEC bus.
[src/mess/drivers]c16.c
[src/mess/machine]c1551.c c16.c

src/mess/machine/c16.c
r6702r6703
1515
1616#include "machine/6525tpi.h"
1717#include "video/ted7360.h"
18#include "includes/cbmserb.h"
18#include "machine/cbmiec.h"
1919#include "includes/vc1541.h"
2020#include "includes/cbmdrive.h"
2121
r6702r6703
113113
114114void c16_m7501_port_write( const device_config *device, UINT8 direction, UINT8 data )
115115{
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");
118117
119118   /* 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));
123122
124123   cassette_output(devtag_get_device(device->machine, "cassette"), !(data & 0x02) ? -(0x5a9e >> 1) : +(0x5a9e >> 1));
125124
r6702r6703
130129{
131130   UINT8 data = 0xff;
132131   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");
134133
135   if ((c16_port7501 & 0x01) || !cbm_serial_data_read(serbus, 0))
134   if ((c16_port7501 & 0x01) || !cbm_iec_data_r(serbus))
136135      data &= ~0x80;
137136
138   if ((c16_port7501 & 0x02) || !cbm_serial_clock_read(serbus, 0))
137   if ((c16_port7501 & 0x02) || !cbm_iec_clk_r(serbus))
139138      data &= ~0x40;
140139
141140//  data &= ~0x20; // port bit not in pinout
src/mess/machine/c1551.c
r6702r6703
77
88**********************************************************************/
99
10/*
11
12   TODO:
13
14   - move M6510T port handling to cpu core
15   - TCBM bus
16   - connect to C16/Plus4
17
18*/
19
1020#include "driver.h"
1121#include "c1551.h"
1222#include "cpu/m6502/m6502.h"
src/mess/drivers/c16.c
r6702r6703
126126#include "machine/cbmipt.h"
127127#include "video/ted7360.h"
128128#include "devices/messram.h"
129#include "machine/c1541.h"
130#include "machine/c1551.h"
129131
130132/* devices config */
131133#include "includes/cbm.h"
132134#include "includes/cbmdrive.h"
133#include "includes/cbmserb.h"
135#include "machine/cbmiec.h"
134136
135137#include "includes/c16.h"
136138
r6702r6703
412414   c16_m7501_port_write   /* port_write_func */
413415};
414416
417static CBM_IEC_DAISY( c16_iec_no_drives )
418{
419   { "maincpu" },
420   { NULL}
421};
422
423static CBM_IEC_DAISY( c16_iec_1541 )
424{
425   { "maincpu" },
426   { C1541_IEC("c1541") },
427   { NULL}
428};
429
415430static MACHINE_DRIVER_START( c16 )
416431   /* basic machine hardware */
417432   MDRV_CPU_ADD("maincpu", M7501, 1400000)        /* 7.8336 MHz */
r6702r6703
449464   /* cassette */
450465   MDRV_CASSETTE_ADD( "cassette", cbm_cassette_config )
451466
452   /* floppy from serial bus */
453   MDRV_IMPORT_FROM(simulated_drive)
454
455467   /* tpi */
456468   MDRV_TPI6525_ADD("tpi6535_tpi_2", c16_tpi6525_tpi_2_intf)
457469   MDRV_TPI6525_ADD("tpi6535_tpi_3", c16_tpi6525_tpi_3_intf)
458470
459471   MDRV_IMPORT_FROM(c16_cartslot)
460472
473   /* IEC serial bus */
474   MDRV_CBM_IEC_ADD("iec", c16_iec_no_drives)
475
461476   /* internal ram */
462477   MDRV_RAM_ADD("messram")
463478   MDRV_RAM_DEFAULT_SIZE("64K")
r6702r6703
476491   /* emulation code currently supports only one drive */
477492   MDRV_DEVICE_REMOVE("tpi6535_tpi_3")
478493
479   MDRV_DEVICE_REMOVE("serial_bus")   // in the current code, serial bus device is tied to the floppy drive
480494   MDRV_IMPORT_FROM( cpu_c1551 )
481495#ifdef CPU_SYNC
482496   MDRV_QUANTUM_TIME(HZ(60))
r6702r6703
489503static MACHINE_DRIVER_START( c16v )
490504   MDRV_IMPORT_FROM( c16 )
491505
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)
494510#ifdef CPU_SYNC
495511   MDRV_QUANTUM_TIME(HZ(60))
496512#else
r6702r6703
528544   MDRV_TPI6525_ADD("tpi6535_tpi_2", c16_tpi6525_tpi_2_c1551_intf)
529545
530546   /* 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
532547   MDRV_DEVICE_REMOVE("tpi6535_tpi_3")
533548
534549   MDRV_IMPORT_FROM( cpu_c1551 )
r6702r6703
546561static MACHINE_DRIVER_START( plus4v )
547562   MDRV_IMPORT_FROM( plus4 )
548563
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)
551568
552569   MDRV_SCREEN_MODIFY("screen")
553570   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
r6702r6703
636653   ROM_REGION( 0x40000, "maincpu", 0 )
637654   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
638655   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")
642656ROM_END
643657
644658#define rom_c116      rom_c16
r6702r6703
684698
685699   ROM_LOAD( "317053-01.bin", 0x18000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f) )
686700   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")
690701ROM_END
691702
692703
r6702r6703
705716   CONFIG_DEVICE(c1551_device_getinfo)
706717SYSTEM_CONFIG_END
707718
708static SYSTEM_CONFIG_START(c16v)
709   CONFIG_DEVICE(vc1541_device_getinfo)
710SYSTEM_CONFIG_END
711
712719static SYSTEM_CONFIG_START(plus)
713720   CONFIG_DEVICE(cbmfloppy_device_getinfo)
714721SYSTEM_CONFIG_END
r6702r6703
717724   CONFIG_DEVICE(c1551_device_getinfo)
718725SYSTEM_CONFIG_END
719726
720static SYSTEM_CONFIG_START(plusv)
721   CONFIG_DEVICE(vc1541_device_getinfo)
722SYSTEM_CONFIG_END
723727
724728/***************************************************************************
725729
r6702r6703
731735
732736COMP( 1984, c16,     0,     0,  c16,    c16,    c16,    c16,     "Commodore Business Machines Co.",  "Commodore 16 (PAL)", 0)
733737COMP( 1984, c16c,    c16,   0,  c16c,   c16,    c16c,   c16c,    "Commodore Business Machines Co.",  "Commodore 16 (PAL, 1551)", 0 )
734COMP( 1984, c16v,    c16,   0,  c16v,   c16,    c16v,   c16v,    "Commodore Business Machines Co.",  "Commodore 16 (PAL, VC1541)", GAME_NOT_WORKING)
738COMP( 1984, c16v,    c16,   0,  c16v,   c16,    c16v,   0,    "Commodore Business Machines Co.",  "Commodore 16 (PAL, VC1541)", GAME_NOT_WORKING)
735739COMP( 1984, c16hun,  c16,   0,  c16,    c16,    c16,    c16,     "Commodore Business Machines Co.",  "Commodore 16 Novotrade (PAL, Hungary)", 0)
736740
737741COMP( 1984, c116,    c16,   0,  c16,    c16,    c16,    c16,     "Commodore Business Machines Co.",  "Commodore 116 (PAL)", 0)
738742COMP( 1984, c116c,    c16,   0,  c16c,   c16,    c16c,   c16c,    "Commodore Business Machines Co.",  "Commodore 116 (PAL, 1551)", 0 )
739COMP( 1984, c116v,   c16,   0,  c16v,   c16,    c16v,   c16v,    "Commodore Business Machines Co.",  "Commodore 116 (PAL, VC1541)", GAME_NOT_WORKING)
743COMP( 1984, c116v,   c16,   0,  c16v,   c16,    c16v,   0,    "Commodore Business Machines Co.",  "Commodore 116 (PAL, VC1541)", GAME_NOT_WORKING)
740744
741745COMP( 1984, plus4,   c16,   0,  plus4,  plus4,  c16,    plus,    "Commodore Business Machines Co.",  "Commodore Plus/4 (NTSC)", 0)
742746COMP( 1984, plus4c,  c16,   0,  plus4c, plus4,  c16c,   plusc,   "Commodore Business Machines Co.",  "Commodore Plus/4 (NTSC, 1551)", 0 )
743COMP( 1984, plus4v,  c16,   0,  plus4v, plus4,  c16v,   plusv,   "Commodore Business Machines Co.",  "Commodore Plus/4 (NTSC, VC1541)", GAME_NOT_WORKING)
747COMP( 1984, plus4v,  c16,   0,  plus4v, plus4,  c16v,   0,   "Commodore Business Machines Co.",  "Commodore Plus/4 (NTSC, VC1541)", GAME_NOT_WORKING)
744748
745749COMP( 1984, c232,    c16,   0,  c16,    c16,    c16,    c16,     "Commodore Business Machines Co.",  "Commodore 232 (Prototype)", 0)
746750COMP( 1984, c264,    c16,   0,  c264,   plus4,  c16,    plus,    "Commodore Business Machines Co.",  "Commodore 264 (Prototype)", 0)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team