Previous 15994 Revisions Next

r6696 Thursday 17th December, 2009 at 17:35:58 UTC by Curt Coder
[CBMIEC] Refactored IEC to use devcb, added C1563, added C1571 floppy reading and connected it to C128, removed remnants of old floppy hack.
[src/mess/drivers]c128.c c64.c vc20.c
[src/mess/machine]c128.c c1541.c c1541.h c1571.c c1571.h c1581.c c1581.h c64.c cbmiec.c cbmiec.h vc20.c

src/mess/machine/cbmiec.c
r6695r6696
223223
224224   int line[SIGNAL_COUNT];                  /* serial signal states */
225225
226   cbm_iec_line            out_line_func[SIGNAL_COUNT];
226   devcb_resolved_write_line   out_line_func[SIGNAL_COUNT];
227227};
228228
229229typedef struct _cbm_iec_t cbm_iec_t;
r6695r6696
293293
294294   for ( ; daisy != NULL; daisy = daisy->next)
295295   {
296      if (daisy->out_line_func[line]) (daisy->out_line_func[line])(daisy->device, data);
296      devcb_call_write_line(&daisy->out_line_func[line], data);
297297   }
298298
299299   if (LOG) logerror("CBM IEC: SRQ %u ATN %u CLK %u DATA %u RESET %u\n", get_signal(iec, SRQ),get_signal(iec, ATN),get_signal(iec, CLK),get_signal(iec, DATA),get_signal(iec, RESET));
r6695r6696
386386         (*tailptr)->line[i] = 1;
387387      }
388388
389      (*tailptr)->out_line_func[SRQ] = (cbm_iec_line)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_CBM_IEC_SRQ);
390      (*tailptr)->out_line_func[ATN] = (cbm_iec_line)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_CBM_IEC_ATN);
391      (*tailptr)->out_line_func[CLK] = (cbm_iec_line)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_CBM_IEC_CLK);
392      (*tailptr)->out_line_func[DATA] = (cbm_iec_line)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_CBM_IEC_DATA);
393      (*tailptr)->out_line_func[RESET] = (cbm_iec_line)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_CBM_IEC_RESET);
389      devcb_resolve_write_line(&(*tailptr)->out_line_func[SRQ], &daisy->out_srq_func, device);
390      devcb_resolve_write_line(&(*tailptr)->out_line_func[ATN], &daisy->out_atn_func, device);
391      devcb_resolve_write_line(&(*tailptr)->out_line_func[CLK], &daisy->out_clk_func, device);
392      devcb_resolve_write_line(&(*tailptr)->out_line_func[DATA], &daisy->out_data_func, device);
393      devcb_resolve_write_line(&(*tailptr)->out_line_func[RESET], &daisy->out_reset_func, device);
394394
395395      tailptr = &(*tailptr)->next;
396396   }
src/mess/machine/cbmiec.h
r6695r6696
2525#define CBM_IEC_DAISY(_name) \
2626   const cbm_iec_daisy_chain (_name)[] =
2727
28enum
29{
30   DEVINFO_FCT_CBM_IEC_SRQ = DEVINFO_FCT_DEVICE_SPECIFIC,
31   DEVINFO_FCT_CBM_IEC_ATN,
32   DEVINFO_FCT_CBM_IEC_CLK,
33   DEVINFO_FCT_CBM_IEC_DATA,
34   DEVINFO_FCT_CBM_IEC_RESET
35};
36
37#define CBM_IEC_SRQ_NAME(name)      cbm_iec_srq_##name
38#define CBM_IEC_SRQ(name)         void CBM_IEC_SRQ_NAME(name)(const device_config *device, int state)
39
40#define CBM_IEC_ATN_NAME(name)      cbm_iec_atn_##name
41#define CBM_IEC_ATN(name)         void CBM_IEC_ATN_NAME(name)(const device_config *device, int state)
42
43#define CBM_IEC_CLK_NAME(name)      cbm_iec_clk_##name
44#define CBM_IEC_CLK(name)         void CBM_IEC_CLK_NAME(name)(const device_config *device, int state)
45
46#define CBM_IEC_DATA_NAME(name)      cbm_iec_data_##name
47#define CBM_IEC_DATA(name)         void CBM_IEC_DATA_NAME(name)(const device_config *device, int state)
48
49#define CBM_IEC_RESET_NAME(name)   cbm_iec_reset_##name
50#define CBM_IEC_RESET(name)         void CBM_IEC_RESET_NAME(name)(const device_config *device, int state)
51
5228/***************************************************************************
5329    TYPE DEFINITIONS
5430***************************************************************************/
r6695r6696
5733struct _cbm_iec_daisy_chain
5834{
5935   const char *tag;   /* device tag */
36
37   devcb_write_line   out_srq_func;
38   devcb_write_line   out_atn_func;
39   devcb_write_line   out_clk_func;
40   devcb_write_line   out_data_func;
41   devcb_write_line   out_reset_func;
6042};
6143
62typedef void (*cbm_iec_line)(const device_config *device, int state);
63
6444/***************************************************************************
6545    PROTOTYPES
6646***************************************************************************/
src/mess/machine/c1581.c
r6695r6696
11/**********************************************************************
22
3    Commodore 1581 Single Disk Drive emulation
3    Commodore 1581/1563 Single Disk Drive emulation
44
55    Copyright MESS Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
r6695r6696
6868{
6969   assert(device != NULL);
7070   assert(device->token != NULL);
71   assert(device->type == C1581);
71   assert((device->type == C1581) || (device->type == C1563));
7272   return (c1581_t *)device->token;
7373}
7474
7575INLINE c1581_config *get_safe_config(const device_config *device)
7676{
7777   assert(device != NULL);
78   assert(device->type == C1581);
78   assert((device->type == C1581) || (device->type == C1563));
7979   return (c1581_config *)device->inline_config;
8080}
8181
r6695r6696
8484***************************************************************************/
8585
8686/*-------------------------------------------------
87    c1581_atn_w - serial bus attention
87    c1581_iec_atn_w - serial bus attention
8888-------------------------------------------------*/
8989
90static CBM_IEC_ATN( c1581 )
90WRITE_LINE_DEVICE_HANDLER( c1581_iec_atn_w )
9191{
9292   c1581_t *c1581 = get_safe_token(device);
9393   int data_out = !c1581->data_out && !(c1581->atn_ack && !state);
r6695r6696
9898}
9999
100100/*-------------------------------------------------
101    c1581_reset_w - serial bus reset
101    c1581_iec_reset_w - serial bus reset
102102-------------------------------------------------*/
103103
104static CBM_IEC_RESET( c1581 )
104WRITE_LINE_DEVICE_HANDLER( c1581_iec_reset_w )
105105{
106106   if (!state)
107107   {
r6695r6696
121121ADDRESS_MAP_END
122122
123123/*-------------------------------------------------
124    ADDRESS_MAP( c1563_map )
125-------------------------------------------------*/
126
127static ADDRESS_MAP_START( c1563_map, ADDRESS_SPACE_PROGRAM, 8 )
128   AM_RANGE(0x0000, 0x1fff) AM_MIRROR(0x2000) AM_RAM
129   AM_RANGE(0x4000, 0x400f) AM_MIRROR(0x1ff0) AM_DEVREADWRITE(M8520_TAG, cia_r, cia_w)
130   AM_RANGE(0x6000, 0x6003) AM_MIRROR(0x1ffc) AM_DEVREADWRITE(WD1770_TAG, wd17xx_r, wd17xx_w)
131   AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("c1563", 0)
132ADDRESS_MAP_END
133
134/*-------------------------------------------------
124135    cia6526_interface c1581_cia_intf
125136-------------------------------------------------*/
126137
r6695r6696
322333MACHINE_DRIVER_END
323334
324335/*-------------------------------------------------
336    MACHINE_DRIVER( c1563 )
337-------------------------------------------------*/
338
339static MACHINE_DRIVER_START( c1563 )
340   MDRV_CPU_ADD(M6502_TAG, M6502, XTAL_16MHz/8)
341   MDRV_CPU_PROGRAM_MAP(c1563_map)
342
343   MDRV_CIA8520_ADD(M8520_TAG, XTAL_16MHz/8, c1581_cia_intf)
344   MDRV_WD1770_ADD(WD1770_TAG, /*XTAL_16MHz/2,*/ c1581_wd1770_intf)
345
346   MDRV_FLOPPY_DRIVE_ADD(FLOPPY_0, c1581_floppy_config)
347MACHINE_DRIVER_END
348
349/*-------------------------------------------------
325350    ROM( c1581 )
326351-------------------------------------------------*/
327352
r6695r6696
403428      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(c1581);                  break;
404429      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
405430      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(c1581);                  break;
406      case DEVINFO_FCT_CBM_IEC_ATN:               info->f = (genf *)CBM_IEC_ATN_NAME(c1581);               break;
407      case DEVINFO_FCT_CBM_IEC_RESET:               info->f = (genf *)CBM_IEC_RESET_NAME(c1581);            break;
408431
409432      /* --- the following bits of info are returned as NULL-terminated strings --- */
410433      case DEVINFO_STR_NAME:                     strcpy(info->s, "Commodore 1581");                     break;
r6695r6696
414437      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright the MESS Team");             break;
415438   }
416439}
440
441/*-------------------------------------------------
442    DEVICE_GET_INFO( c1563 )
443-------------------------------------------------*/
444
445DEVICE_GET_INFO( c1563 )
446{
447   switch (state)
448   {
449      /* --- the following bits of info are returned as pointers --- */
450      case DEVINFO_PTR_ROM_REGION:               info->romregion = ROM_NAME(c1563);                     break;
451      case DEVINFO_PTR_MACHINE_CONFIG:            info->machine_config = MACHINE_DRIVER_NAME(c1563);         break;
452
453      /* --- the following bits of info are returned as NULL-terminated strings --- */
454      case DEVINFO_STR_NAME:                     strcpy(info->s, "Commodore 1563");                     break;
455
456      default:                              DEVICE_GET_INFO_CALL(c1581);                        break;
457   }
458}
src/mess/machine/c1581.h
r6695r6696
11/**********************************************************************
22
3    Commodore 1581 Single Disk Drive emulation
3    Commodore 1581/1563 Single Disk Drive emulation
44
55    Copyright MESS Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
r6695r6696
1717***************************************************************************/
1818
1919#define C1581 DEVICE_GET_INFO_NAME( c1581 )
20#define C1563 DEVICE_GET_INFO_NAME( c1563 )
2021
2122#define MDRV_C1581_ADD(_tag, _serial_bus_tag, _address) \
2223   MDRV_DEVICE_ADD(_tag, C1581, 0) \
2324   MDRV_DEVICE_CONFIG_DATAPTR(c1581_config, serial_bus_tag, _serial_bus_tag) \
2425   MDRV_DEVICE_CONFIG_DATA32(c1581_config, address, _address)
2526
27#define MDRV_C1563_ADD(_tag, _serial_bus_tag, _address) \
28   MDRV_DEVICE_ADD(_tag, C1563, 0) \
29   MDRV_DEVICE_CONFIG_DATAPTR(c1581_config, serial_bus_tag, _serial_bus_tag) \
30   MDRV_DEVICE_CONFIG_DATA32(c1581_config, address, _address)
31
32#define C1581_IEC(_tag) \
33   _tag, DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, c1581_iec_atn_w), DEVCB_NULL, DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, c1581_iec_reset_w)
34
2635/***************************************************************************
2736    TYPE DEFINITIONS
2837***************************************************************************/
r6695r6696
4049
4150/* device interface */
4251DEVICE_GET_INFO( c1581 );
52DEVICE_GET_INFO( c1563 );
4353
54/* IEC interface */
55WRITE_LINE_DEVICE_HANDLER( c1581_iec_atn_w );
56WRITE_LINE_DEVICE_HANDLER( c1581_iec_reset_w );
57
4458#endif
src/mess/machine/c128.c
r6695r6696
1010***************************************************************************/
1111
1212#include "driver.h"
13
13#include "includes/c128.h"
14#include "includes/c64.h"
15#include "includes/cbm.h"
16#include "machine/cbmiec.h"
1417#include "cpu/m6502/m6502.h"
15#include "sound/sid6581.h"
18#include "devices/cassette.h"
1619#include "machine/6526cia.h"
17
18#include "includes/cbm.h"
19#include "includes/cbmserb.h"
20#include "includes/cbmdrive.h"
21#include "includes/vc1541.h"
20#include "sound/sid6581.h"
2221#include "video/vic6567.h"
2322#include "video/vdc8563.h"
2423
25
26#include "includes/c128.h"
27#include "includes/c64.h"
28
29#include "devices/cassette.h"
30
31
3224#define VERBOSE_LEVEL 0
3325#define DBG_LOG( MACHINE, N, M, A ) \
3426   do { \
r6695r6696
7769
7870static int c128_va1617;
7971static int c128_cia1_on;
80static UINT8 serial_clock, serial_data, serial_atn;
8172static UINT8 vicirq;
82static int emulated_drive;
8373
8474static void c128_nmi( running_machine *machine )
8575{
r6695r6696
237227static READ8_DEVICE_HANDLER( c128_cia1_port_a_r )
238228{
239229   UINT8 value = 0xff;
240   const device_config *serbus = devtag_get_device(device->machine, "serial_bus");
230   const device_config *serbus = devtag_get_device(device->machine, "iec");
241231
242   if (!serial_clock || !cbm_serial_clock_read(serbus, 0))
232   if (!cbm_iec_clk_r(serbus))
243233      value &= ~0x40;
244234
245   if (!serial_data || !cbm_serial_data_read(serbus, 0))
235   if (!cbm_iec_data_r(serbus))
246236      value &= ~0x80;
247237
248238   return value;
r6695r6696
251241static WRITE8_DEVICE_HANDLER( c128_cia1_port_a_w )
252242{
253243   static const int helper[4] = {0xc000, 0x8000, 0x4000, 0x0000};
254   const device_config *serbus = devtag_get_device(device->machine, "serial_bus");
244   const device_config *serbus = devtag_get_device(device->machine, "iec");
255245
256   cbm_serial_clock_write(serbus, 0, serial_clock = !(data & 0x10));
257   cbm_serial_data_write(serbus, 0, serial_data = !(data & 0x20));
258   cbm_serial_atn_write(serbus, 0, serial_atn = !(data & 0x08));
246   cbm_iec_clk_w(serbus, device, !(data & 0x10));
247   cbm_iec_data_w(serbus, device, !(data & 0x20));
248   cbm_iec_atn_w(serbus, device, !(data & 0x08));
259249   c64_vicaddr = c64_memory + helper[data & 0x03];
260250   c128_vicaddr = c64_memory + helper[data & 0x03] + c128_va1617;
261251}
r6695r6696
10991089{
11001090   c64_tape_on = 1;
11011091   c64_pal = 0;
1102   emulated_drive = 0;
11031092   c128_common_driver_init(machine);
11041093   vic6567_init(1, c64_pal, c128_dma_read, c128_dma_read_color, c128_vic_interrupt);
11051094   vic2_set_rastering(0);
r6695r6696
11111100{
11121101   c64_tape_on = 1;
11131102   c64_pal = 1;
1114   emulated_drive = 0;
11151103   c128_common_driver_init(machine);
11161104   vic6567_init(1, c64_pal, c128_dma_read, c128_dma_read_color, c128_vic_interrupt);
11171105   vic2_set_rastering(1);
r6695r6696
11221110DRIVER_INIT( c128d )
11231111{
11241112   DRIVER_INIT_CALL( c128 );
1125   emulated_drive = 1;
1126   cbm_drive_config(machine, type_1571, 0, 0, "cpu_vc1571", 8);
11271113}
11281114
11291115DRIVER_INIT( c128dpal )
11301116{
11311117   DRIVER_INIT_CALL( c128pal );
1132   emulated_drive = 1;
1133   cbm_drive_config(machine, type_1571, 0, 0, "cpu_vc1571", 8);
11341118}
11351119
11361120DRIVER_INIT( c128dcr )
11371121{
11381122   DRIVER_INIT_CALL( c128 );
1139   emulated_drive = 1;
1140   cbm_drive_config(machine, type_1571cr, 0, 0, "cpu_vc1571", 8);
11411123}
11421124
11431125DRIVER_INIT( c128dcrp )
11441126{
11451127   DRIVER_INIT_CALL( c128pal );
1146   emulated_drive = 1;
1147   cbm_drive_config(machine, type_1571cr, 0, 0, "cpu_vc1571", 8);
11481128}
11491129
11501130DRIVER_INIT( c128d81 )
11511131{
11521132   DRIVER_INIT_CALL( c128 );
1153   emulated_drive = 1;
1154   cbm_drive_config(machine, type_1581, 0, 0, "cpu_vc1571", 8);
11551133}
11561134
11571135MACHINE_START( c128 )
11581136{
1159   if (emulated_drive)
1160   {
1161      cbm_drive_reset(machine);
1162   }
1163   else if (c128_cia1_on)
1164   {
1165      cbm_drive_0_config(SERIAL, 8);
1166      cbm_drive_1_config(SERIAL, 9);
1167      serial_clock = serial_data = serial_atn = 1;
1168   }
1169
11701137// This was in MACHINE_START( c64 ), but never called
11711138// TO DO: find its correct use, when fixing c64 mode
11721139   if (c64mode)
src/mess/machine/c1541.c
r6695r6696
290290}
291291
292292/*-------------------------------------------------
293    c1541_atn_w - serial bus attention
293    c1541_iec_atn_w - serial bus attention
294294-------------------------------------------------*/
295295
296static CBM_IEC_ATN( c1541 )
296WRITE_LINE_DEVICE_HANDLER( c1541_iec_atn_w )
297297{
298298   c1541_t *c1541 = get_safe_token(device);
299299   int data_out = !c1541->data_out && !(c1541->atna ^ !state);
r6695r6696
304304}
305305
306306/*-------------------------------------------------
307    c1541_reset_w - serial bus reset
307    c1541_iec_reset_w - serial bus reset
308308-------------------------------------------------*/
309309
310static CBM_IEC_RESET( c1541 )
310WRITE_LINE_DEVICE_HANDLER( c1541_iec_reset_w )
311311{
312312   if (!state)
313313   {
r6695r6696
10741074      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(c1541);                  break;
10751075      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
10761076      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(c1541);                  break;
1077      case DEVINFO_FCT_CBM_IEC_ATN:               info->f = (genf *)CBM_IEC_ATN_NAME(c1541);               break;
1078      case DEVINFO_FCT_CBM_IEC_RESET:               info->f = (genf *)CBM_IEC_RESET_NAME(c1541);            break;
10791077
10801078      /* --- the following bits of info are returned as NULL-terminated strings --- */
10811079      case DEVINFO_STR_NAME:                     strcpy(info->s, "Commodore VIC-1540");                  break;
src/mess/machine/c1541.h
r6695r6696
4646   MDRV_DEVICE_ADD(_tag, C2031, 0) \
4747   MDRV_DEVICE_CONFIG_DATA32(c1541_config, address, _address)
4848
49#define C1541_IEC(_tag) \
50   _tag, DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, c1541_iec_atn_w), DEVCB_NULL, DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, c1541_iec_reset_w)
51
4952/***************************************************************************
5053    TYPE DEFINITIONS
5154***************************************************************************/
r6695r6696
6871DEVICE_GET_INFO( c1541ii );
6972DEVICE_GET_INFO( c2031 );
7073
74/* IEC interface */
75WRITE_LINE_DEVICE_HANDLER( c1541_iec_atn_w );
76WRITE_LINE_DEVICE_HANDLER( c1541_iec_reset_w );
77
7178#endif
src/mess/machine/vc20.c
r6695r6696
1919
2020#include "machine/6522via.h"
2121#include "video/vic6560.h"
22#include "includes/vc1541.h"
2322#include "machine/cbmiec.h"
2423#include "includes/cbmieeeb.h"
2524#include "includes/cbmdrive.h"
r6695r6696
4544{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
4645
4746static int via1_portb, via1_porta, via0_ca2;
48static int serial_atn, serial_clock, serial_data;
4947
50static int has_vc1541;
5148static int ieee; /* ieee cartridge (interface and rom)*/
5249static UINT8 *vc20_rom_2000;
5350static UINT8 *vc20_rom_4000;
r6695r6696
133130   const device_config *serbus = devtag_get_device(device->machine, "iec");
134131
135132   cbm_iec_atn_w(serbus, device, !(data & 0x80));
136   DBG_LOG(device->machine, 1, "serial out", ("atn %s\n", serial_atn ? "high" : "low"));
137133}
138134
139135/* via 1 addr 0x9120
r6695r6696
592588{
593589   vc20_memory_init(machine);
594590
595   serial_atn = 1;
596   serial_clock = 1;
597   serial_data = 1;
598
599591   datasette_timer = timer_alloc(machine, vic20_tape_timer, NULL);
600
601   if (has_vc1541)
602      cbm_drive_config(machine, type_1541, 0, 0, "cpu_vc1540", 8);
603592}
604593
605594DRIVER_INIT( vc20 )
606595{
607596   ieee = 0;
608   has_vc1541 = 0;
609597   vc20_common_driver_init(machine);
610598   vic6561_init(vic6560_dma_read, vic6560_dma_read_color);
611599}
r6695r6696
613601DRIVER_INIT( vic20 )
614602{
615603   ieee = 0;
616   has_vc1541 = 0;
617604   vc20_common_driver_init(machine);
618605   vic6560_init(vic6560_dma_read, vic6560_dma_read_color);
619606}
r6695r6696
626613DRIVER_INIT( vc20v )
627614{
628615   ieee = 0;
629   has_vc1541 = 1;
630616   vc20_common_driver_init(machine);
631617   vic6561_init(vic6560_dma_read, vic6560_dma_read_color);
632618}
r6695r6696
634620DRIVER_INIT( vic20v )
635621{
636622   ieee = 0;
637   has_vc1541 = 1;
638623   vc20_common_driver_init(machine);
639624   vic6560_init(vic6560_dma_read, vic6560_dma_read_color);
640625}
r6695r6696
642627DRIVER_INIT( vic20i )
643628{
644629   ieee = 1;
645   has_vc1541 = 0;
646630   vc20_common_driver_init(machine);
647631   vic6560_init(vic6560_dma_read, vic6560_dma_read_color);
648632}
r6695r6696
651635{
652636   const device_config *via_0 = devtag_get_device(machine, "via6522_0");
653637
654   if (has_vc1541)
638   if (ieee)
655639   {
656      cbm_drive_reset(machine);
640      cbm_drive_0_config(IEEE, 8);
641      cbm_drive_1_config(IEEE, 9);
657642   }
658   else
659   {
660      if (ieee)
661      {
662         cbm_drive_0_config(IEEE, 8);
663         cbm_drive_1_config(IEEE, 9);
664      }
665      else
666      {
667         cbm_drive_0_config(SERIAL, 8);
668         cbm_drive_1_config(SERIAL, 9);
669      }
670   }
671643
672644   via_ca1_w(via_0, 0, vc20_via0_read_ca1(via_0, 0));
673645
src/mess/machine/c1571.c
r6695r6696
2929#define M6526_TAG      "u20"
3030#define WD1770_TAG      "u11"
3131 
32static const double C1571_BITRATE[4] =
33{
34   XTAL_16MHz/13.0,   /* tracks 1-17 */
35   XTAL_16MHz/14.0,   /* tracks 18-24 */
36   XTAL_16MHz/15.0,    /* tracks 25-30 */
37   XTAL_16MHz/16.0      /* tracks 31-42 */
38};
39 
40#define SYNC_MARK         0x3ff      /* 10 consecutive 1-bits */
41 
42#define TRACK_BUFFER_SIZE   8194      /* 2 bytes track length + maximum of 8192 bytes of GCR encoded data */
43#define TRACK_DATA_START   2
44 
3245/***************************************************************************
3346    TYPE DEFINITIONS
3447***************************************************************************/
r6695r6696
3851{
3952   /* abstractions */
4053   int address;
54   UINT8 track_buffer[TRACK_BUFFER_SIZE];            /* track data buffer */
55   int track_len;                  /* track length */
56   int buffer_pos;                  /* current byte position within track buffer */
57   int bit_pos;                  /* current bit position within track buffer byte */
58   int bit_count;                  /* current data byte bit counter */
59   UINT16 data;                  /* data shift register */
4160 
4261   /* signals */
43   int data_out;
44   int atn_ack;
62   UINT8 yb;                     /* GCR data byte to write */
63   int byte;                     /* byte ready */
64   int atna;                     /* attention acknowledge */
65   int ds;                        /* density select */
66   int stp;                     /* stepping motor */
4567   int soe;                     /* s? output enable */
4668   int mode;                     /* mode (0 = write, 1 = read) */
4769 
70   int data_out;
71   int atn_ack;
72 
4873   /* interrupts */
4974   int via0_irq;                  /* VIA #0 interrupt request */
5075   int via1_irq;                  /* VIA #1 interrupt request */
r6695r6696
5883   const device_config *wd1770;
5984   const device_config *serial_bus;
6085   const device_config *image;
86 
87   /* timers */
88   emu_timer *bit_timer;
6189};
6290 
6391/***************************************************************************
r6695r6696
84112***************************************************************************/
85113 
86114/*-------------------------------------------------
87    c1571_atn_w - serial bus attention
115    TIMER_CALLBACK( bit_tick )
88116-------------------------------------------------*/
89117 
90static CBM_IEC_ATN( c1571 )
118static TIMER_CALLBACK( bit_tick )
91119{
120   const device_config *device = (device_config *)ptr;
92121   c1571_t *c1571 = get_safe_token(device);
122   int byte = 0;
123 
124   /* shift in data from the read head */
125   c1571->data <<= 1;
126   c1571->data |= BIT(c1571->track_buffer[c1571->buffer_pos], c1571->bit_pos);
127   c1571->bit_pos--;
128   c1571->bit_count++;
129 
130   if (c1571->bit_pos < 0)
131   {
132      c1571->bit_pos = 7;
133      c1571->buffer_pos++;
134 
135      if (c1571->buffer_pos > c1571->track_len + 1)
136      {
137         /* loop to the start of the track */
138         c1571->buffer_pos = TRACK_DATA_START;
139      }
140   }
141 
142   if ((c1571->data & SYNC_MARK) == SYNC_MARK)
143   {
144      /* SYNC detected */
145      c1571->bit_count = 0;
146   }
147 
148   if (c1571->bit_count > 7)
149   {
150      /* byte ready */
151      c1571->bit_count = 0;
152      byte = 1;
153 
154      if (!(c1571->data & 0xff))
155      {
156         /* simulate weak bits with randomness */
157         c1571->data = (c1571->data & 0xff00) | (mame_rand(machine) & 0xff);
158      }
159   }
160 
161   if (c1571->byte != byte)
162   {
163      int byte_ready = !(byte && c1571->soe);
164 
165      cpu_set_input_line(c1571->cpu, M6502_SET_OVERFLOW, byte_ready);
166      via_ca1_w(c1571->via1, 0, byte_ready);
167 
168      c1571->byte = byte;
169   }
170}
171 
172/*-------------------------------------------------
173    c1571_iec_atn_w - serial bus attention
174-------------------------------------------------*/
175 
176WRITE_LINE_DEVICE_HANDLER( c1571_iec_atn_w )
177{
178   c1571_t *c1571 = get_safe_token(device);
93179   int data_out = !c1571->data_out && !(c1571->atn_ack ^ !state);
94180 
95181   via_ca1_w(c1571->via0, 0, !state);
r6695r6696
98184}
99185 
100186/*-------------------------------------------------
101    c1571_reset_w - serial bus reset
187    c1571_iec_reset_w - serial bus reset
102188-------------------------------------------------*/
103189 
104static CBM_IEC_RESET( c1571 )
190WRITE_LINE_DEVICE_HANDLER( c1571_iec_reset_w )
105191{
106192   if (!state)
107193   {
r6695r6696
204290 
205291   c1571_t *c1571 = get_safe_token(device->owner);
206292 
293   /* 1/2 MHz */
294   UINT32 clock = BIT(data, 5) ? XTAL_16MHz/8 : XTAL_16MHz/16;
295 
296   device_set_clock(c1571->cpu, clock);
297   device_set_clock(c1571->cia, clock);
298   device_set_clock(c1571->via0, clock);
299   device_set_clock(c1571->via1, clock);
300 
207301   /* side */
208302   wd17xx_set_side(c1571->wd1770, BIT(data, 2));
209303}
r6695r6696
392486        PB7     _SYNC       SYNC detect line
393487 
394488    */
489 
490   c1571_t *c1571 = get_safe_token(device->owner);
491   int stp = data & 0x03;
492   int ds = (data >> 5) & 0x03;
493   int mtr = BIT(data, 2);
494 
495   /* stepper motor */
496   if (c1571->stp != stp)
497   {
498      int tracks = 0;
499 
500      switch (c1571->stp)
501      {
502      case 0:   if (stp == 1) tracks++; else if (stp == 3) tracks--; break;
503      case 1:   if (stp == 2) tracks++; else if (stp == 0) tracks--; break;
504      case 2: if (stp == 3) tracks++; else if (stp == 1) tracks--; break;
505      case 3: if (stp == 0) tracks++; else if (stp == 2) tracks--; break;
506      }
507 
508      if (tracks != 0)
509      {
510         c1571->track_len = TRACK_BUFFER_SIZE;
511         c1571->buffer_pos = TRACK_DATA_START;
512         c1571->bit_pos = 7;
513         c1571->bit_count = 0;
514 
515         /* step read/write head */
516         floppy_drive_seek(c1571->image, tracks);
517 
518         /* read track data */
519         floppy_drive_read_track_data_info_buffer(c1571->image, 0, c1571->track_buffer, &c1571->track_len);
520 
521         /* extract track length */
522         c1571->track_len = (c1571->track_buffer[1] << 8) | c1571->track_buffer[0];
523      }
524 
525      c1571->stp = stp;
526   }
527 
528   /* spindle motor */
529   floppy_mon_w(c1571->image, !mtr);
530   timer_enable(c1571->bit_timer, mtr);
531 
532   /* activity LED */
533 
534   /* density select */
535   if (c1571->ds != ds)
536   {
537      timer_adjust_periodic(c1571->bit_timer, attotime_zero, 0, ATTOTIME_IN_HZ(C1571_BITRATE[ds]/4));
538      c1571->ds = ds;
539   }
395540}
396541 
397542static WRITE_LINE_DEVICE_HANDLER( soe_w )
398543{
399544   c1571_t *c1571 = get_safe_token(device->owner);
545   int byte_ready = !(state && c1571->byte);
400546 
401547   c1571->soe = state;
548 
549   cpu_set_input_line(c1571->cpu, M6502_SET_OVERFLOW, byte_ready);
550   via_ca1_w(device, 0, byte_ready);
402551}
403552 
404553static WRITE_LINE_DEVICE_HANDLER( mode_w )
r6695r6696
467616-------------------------------------------------*/
468617 
469618static FLOPPY_OPTIONS_START( c1571 )
470   FLOPPY_OPTION( c1571, "g64", "Commodore 1541 GCR Disk Image", g64_dsk_identify, g64_dsk_construct, NULL )
471//  FLOPPY_OPTION( c1571, "d64", "Commodore 1541 Disk Image", d64_dsk_identify, d64_dsk_construct, NULL )
619   FLOPPY_OPTION( c1571, "g64", "Commodore 1571 GCR Disk Image", g64_dsk_identify, g64_dsk_construct, NULL )
620//  FLOPPY_OPTION( c1571, "d64", "Commodore 1571 Disk Image", d64_dsk_identify, d64_dsk_construct, NULL )
472621//  FLOPPY_OPTION( c1571, "d71", "Commodore 1571 Disk Image", d64_dsk_identify, d64_dsk_construct, NULL )
473622FLOPPY_OPTIONS_END
474623 
r6695r6696
509658-------------------------------------------------*/
510659 
511660static MACHINE_DRIVER_START( c1570 )
512   MDRV_CPU_ADD(M6502_TAG, M6502, 2000000)
661   MDRV_CPU_ADD(M6502_TAG, M6502, XTAL_16MHz/8)
513662   MDRV_CPU_PROGRAM_MAP(c1570_map)
514663 
515   MDRV_VIA6522_ADD(M6522_0_TAG, 2000000, c1571_via0_intf)
516   MDRV_VIA6522_ADD(M6522_1_TAG, 2000000, c1571_via1_intf)
517   MDRV_CIA6526_ADD(M6526_TAG, CIA6526R1, 2000000, c1571_cia_intf)
664   MDRV_VIA6522_ADD(M6522_0_TAG, XTAL_16MHz/8, c1571_via0_intf)
665   MDRV_VIA6522_ADD(M6522_1_TAG, XTAL_16MHz/8, c1571_via1_intf)
666   MDRV_CIA6526_ADD(M6526_TAG, CIA6526R1, XTAL_16MHz/8, c1571_cia_intf)
518667   MDRV_WD1770_ADD(WD1770_TAG, c1571_wd1770_intf)
519668 
520669   MDRV_FLOPPY_DRIVE_ADD(FLOPPY_0, c1570_floppy_config)
r6695r6696
525674-------------------------------------------------*/
526675 
527676static MACHINE_DRIVER_START( c1571 )
528   MDRV_CPU_ADD(M6502_TAG, M6502, 2000000)
677   MDRV_CPU_ADD(M6502_TAG, M6502, XTAL_16MHz/8)
529678   MDRV_CPU_PROGRAM_MAP(c1571_map)
530679 
531   MDRV_VIA6522_ADD(M6522_0_TAG, 2000000, c1571_via0_intf)
532   MDRV_VIA6522_ADD(M6522_1_TAG, 2000000, c1571_via1_intf)
533   MDRV_CIA6526_ADD(M6526_TAG, CIA6526R1, 2000000, c1571_cia_intf)
680   MDRV_VIA6522_ADD(M6522_0_TAG, XTAL_16MHz/8, c1571_via0_intf)
681   MDRV_VIA6522_ADD(M6522_1_TAG, XTAL_16MHz/8, c1571_via1_intf)
682   MDRV_CIA6526_ADD(M6526_TAG, CIA6526R1, XTAL_16MHz/8, c1571_cia_intf)
534683   MDRV_WD1770_ADD(WD1770_TAG, c1571_wd1770_intf)
535684 
536685   MDRV_FLOPPY_DRIVE_ADD(FLOPPY_0, c1571_floppy_config)
r6695r6696
541690-------------------------------------------------*/
542691 
543692static MACHINE_DRIVER_START( c1571cr )
544   MDRV_CPU_ADD(M6502_TAG, M6502, 2000000)
693   MDRV_CPU_ADD(M6502_TAG, M6502, XTAL_16MHz/8)
545694   MDRV_CPU_PROGRAM_MAP(c1571cr_map)
546695 
547   MDRV_VIA6522_ADD(M6522_0_TAG, 2000000, c1571_via0_intf)
548   MDRV_VIA6522_ADD(M6522_1_TAG, 2000000, c1571_via1_intf)
549   MDRV_CIA6526_ADD(M6526_TAG, CIA6526R1, 2000000, c1571_cia_intf)
696   MDRV_VIA6522_ADD(M6522_0_TAG, XTAL_16MHz/8, c1571_via0_intf)
697   MDRV_VIA6522_ADD(M6522_1_TAG, XTAL_16MHz/8, c1571_via1_intf)
698   MDRV_CIA6526_ADD(M6526_TAG, CIA6526R1, XTAL_16MHz/8, c1571_cia_intf)
550699   MDRV_WD1770_ADD(WD1770_TAG, c1571_wd1770_intf)
551700 
552701   MDRV_FLOPPY_DRIVE_ADD(FLOPPY_0, c1571_floppy_config)
r6695r6696
604753   c1571->serial_bus = devtag_get_device(device->machine, config->serial_bus_tag);
605754   c1571->image = device_find_child_by_tag(device, FLOPPY_0);
606755 
756   /* set floppy density */
757   wd17xx_set_density(c1571->wd1770, DEN_MFM_LO);
758 
759   /* allocate data timer */
760   c1571->bit_timer = timer_alloc(device->machine, bit_tick, (void *)device);
761 
607762   /* register for state saving */
608763}
609764 
r6695r6696
643798      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(c1571);                  break;
644799      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
645800      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(c1571);                  break;
646      case DEVINFO_FCT_CBM_IEC_ATN:               info->f = (genf *)CBM_IEC_ATN_NAME(c1571);               break;
647      case DEVINFO_FCT_CBM_IEC_RESET:               info->f = (genf *)CBM_IEC_RESET_NAME(c1571);            break;
648801 
649802      /* --- the following bits of info are returned as NULL-terminated strings --- */
650803      case DEVINFO_STR_NAME:                     strcpy(info->s, "Commodore 1570");                     break;
src/mess/machine/c1571.h
r6695r6696
3535   MDRV_DEVICE_CONFIG_DATAPTR(c1571_config, serial_bus_tag, _serial_bus_tag) \
3636   MDRV_DEVICE_CONFIG_DATA32(c1571_config, address, _address)
3737 
38#define C1571_IEC(_tag) \
39   _tag, DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, c1571_iec_atn_w), DEVCB_NULL, DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, c1571_iec_reset_w)
40 
3841/***************************************************************************
3942    TYPE DEFINITIONS
4043***************************************************************************/
r6695r6696
5558DEVICE_GET_INFO( c1571 );
5659DEVICE_GET_INFO( c1571cr );
5760 
61/* IEC interface */
62WRITE_LINE_DEVICE_HANDLER( c1571_iec_atn_w );
63WRITE_LINE_DEVICE_HANDLER( c1571_iec_reset_w );
64 
5865#endif
src/mess/machine/c64.c
r6695r6696
2424#include "video/vdc8563.h"
2525
2626#include "includes/cbm.h"
27#include "includes/cbmdrive.h"
28#include "includes/vc1541.h"
29
3027#include "includes/c64.h"
3128
3229#include "devices/cassette.h"
r6695r6696
7067static int is_sx64;            // temporary workaround until we implement full vc1541 emulation for every c64 set
7168static UINT8 c64_cart_n_banks = 0;
7269
73static UINT8 serial_clock, serial_data, serial_atn;
7470static UINT8 vicirq;
7571
7672static void c64_nmi( running_machine *machine )
r6695r6696
866862   c64_cia1_on = 1;
867863   c64_tape_on = 0;
868864   c64_common_driver_init(machine);
869   cbm_drive_config(machine, type_1541, 0, 0, "cpu_vc1540", 8);
870865}
871866
872867MACHINE_START( c64 )
r6695r6696
876871   c64_io_mirror = auto_alloc_array(machine, UINT8, 0x1000);
877872   c64_io_enabled = 0;
878873
879   if (is_sx64)
880   {
881      cbm_drive_reset(machine);
882   }
883   else if (c64_cia1_on)
884   {
885      cbm_drive_0_config(SERIAL, 8);
886      cbm_drive_1_config(SERIAL, 9);
887      serial_clock = serial_data = serial_atn = 1;
888   }
889
890874   c64_vicaddr = c64_memory;
891875   vicirq = 0;
892876
src/mess/drivers/c128.c
r6695r6696
178178#include "machine/6526cia.h"
179179
180180#include "machine/cbmipt.h"
181#include "machine/c1571.h"
182#include "machine/c1581.h"
181183#include "video/vic6567.h"
182184#include "video/vdc8563.h"
183185
186
184187/* devices config */
185188#include "includes/cbm.h"
186#include "includes/cbmserb.h"
187#include "includes/cbmdrive.h"
188#include "includes/vc1541.h"
189#include "machine/cbmiec.h"
189190
190191#include "includes/c128.h"
191192#include "includes/c64.h"
r6695r6696
578579   c128_m6510_port_write,   /* port_write_func */
579580};
580581
582static CBM_IEC_DAISY( c128_iec_bus )
583{
584   { "cia_1", DEVCB_DEVICE_LINE("cia_0", mos6526_flag_w) },
585   { C1571_IEC("c1571") },
586   { NULL}
587};
581588
589static CBM_IEC_DAISY( c128d81_iec_bus )
590{
591   { "cia_1", DEVCB_DEVICE_LINE("cia_0", mos6526_flag_w) },
592   { C1581_IEC("c1581") },
593   { NULL}
594};
595
582596/*************************************
583597 *
584598 *  Machine driver
r6695r6696
636650   MDRV_CIA6526_ADD("cia_1", CIA6526R1, VIC6567_CLOCK, c128_ntsc_cia1)
637651
638652   /* floppy from serial bus */
639   MDRV_IMPORT_FROM(simulated_drive)
653   MDRV_CBM_IEC_ADD("iec", c128_iec_bus)
654   MDRV_C1571_ADD("c1571", "iec", 8)
640655
641656   MDRV_IMPORT_FROM(c64_cartslot)
642657MACHINE_DRIVER_END
r6695r6696
644659
645660static MACHINE_DRIVER_START( c128d )
646661   MDRV_IMPORT_FROM( c128 )
647
648   MDRV_DEVICE_REMOVE("serial_bus")   // in the current code, serial bus device is tied to the floppy drive
649   MDRV_IMPORT_FROM( cpu_c1571 )
650662MACHINE_DRIVER_END
651663
652664static MACHINE_DRIVER_START( c128dcr )
653665   MDRV_IMPORT_FROM( c128 )
654666
655   MDRV_DEVICE_REMOVE("serial_bus")   // in the current code, serial bus device is tied to the floppy drive
656   MDRV_IMPORT_FROM( cpu_c1571cr )
667   MDRV_DEVICE_REMOVE("c1571")
668   MDRV_C1571CR_ADD("c1571", "iec", 8)
657669MACHINE_DRIVER_END
658670
659671static MACHINE_DRIVER_START( c128d81 )
660672   MDRV_IMPORT_FROM( c128 )
661673
662   MDRV_DEVICE_REMOVE("serial_bus")   // in the current code, serial bus device is tied to the floppy drive
663   MDRV_IMPORT_FROM( cpu_c1581 )
674   MDRV_DEVICE_REMOVE("iec")
675   MDRV_DEVICE_REMOVE("c1571")
676
677   MDRV_CBM_IEC_ADD("iec", c128d81_iec_bus)
678   MDRV_C1563_ADD("c1563", "iec", 8)
664679MACHINE_DRIVER_END
665680
666681
r6695r6696
687702
688703static MACHINE_DRIVER_START( c128dpal )
689704   MDRV_IMPORT_FROM( c128pal )
690
691   MDRV_DEVICE_REMOVE("serial_bus")   // in the current code, serial bus device is tied to the floppy drive
692   MDRV_IMPORT_FROM( cpu_c1571 )
693705MACHINE_DRIVER_END
694706
695707static MACHINE_DRIVER_START( c128dcrp )
696708   MDRV_IMPORT_FROM( c128pal )
697709
698   MDRV_DEVICE_REMOVE("serial_bus")   // in the current code, serial bus device is tied to the floppy drive
699   MDRV_IMPORT_FROM( cpu_c1571cr )
700710MACHINE_DRIVER_END
701711
702712
r6695r6696
847857   ROM_LOAD( "390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) )
848858
849859   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
850   C1571_ROM("cpu_vc1571")
851860   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
852861   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
853862ROM_END
r6695r6696
862871   ROM_LOAD( "390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) )         // Character
863872
864873   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
865   C1571CR_ROM("cpu_vc1571")
866874   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
867875   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
868876ROM_END
r6695r6696
877885   ROM_LOAD( "315079-01.bin", 0x120000, 0x2000, CRC(fe5a2db1) SHA1(638f8aff51c2ac4f99a55b12c4f8c985ef4bebd3) )
878886
879887   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
880   C1571CR_ROM("cpu_vc1571")
881888   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
882889   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
883890ROM_END
r6695r6696
890897   ROM_LOAD( "325181-01.bin", 0x120000, 0x2000, CRC(7a70d9b8) SHA1(aca3f7321ee7e6152f1f0afad646ae41964de4fb) )
891898
892899   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
893   C1571CR_ROM("cpu_vc1571")
894900   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
895901   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
896902ROM_END
r6695r6696
906912   ROM_LOAD( "325167-01.bin", 0x120000, 0x2000, BAD_DUMP CRC(bad36b88) SHA1(9119b27a1bf885fa4c76fff5d858c74c194dd2b8) )
907913
908914   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
909   C1571CR_ROM("cpu_vc1571")
910915   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
911916   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
912917ROM_END
r6695r6696
921926   ROM_LOAD( "390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) )
922927
923928   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
924   C1581_ROM("cpu_vc1571")
925929   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
926930   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
927931ROM_END
928932
929933
930934
931/*************************************
932 *
933 *  System configuration(s)
934 *
935 *************************************/
936
937
938static SYSTEM_CONFIG_START(c128)
939   CONFIG_DEVICE(cbmfloppy_device_getinfo)
940SYSTEM_CONFIG_END
941
942static SYSTEM_CONFIG_START(c128d)
943   CONFIG_DEVICE(c1571_device_getinfo)
944SYSTEM_CONFIG_END
945
946static SYSTEM_CONFIG_START(c128d81)
947   CONFIG_DEVICE(c1581_device_getinfo)
948SYSTEM_CONFIG_END
949
950
951935/***************************************************************************
952936
953937  Game driver(s)
r6695r6696
956940
957941/*    YEAR  NAME     PARENT COMPAT MACHINE   INPUT    INIT      CONFIG COMPANY                             FULLNAME            FLAGS */
958942
959COMP( 1985, c128,      0,     0,   c128,     c128,    c128,     c128,  "Commodore Business Machines Co.", "Commodore 128 (NTSC)", 0)
960COMP( 1985, c128cr,    c128,  0,   c128,     c128,    c128,     c128,  "Commodore Business Machines Co.", "Commodore 128CR (NTSC, proto?)", 0)
943COMP( 1985, c128,      0,     0,   c128,     c128,    c128,     0,  "Commodore Business Machines Co.", "Commodore 128 (NTSC)", 0)
944COMP( 1985, c128cr,    c128,  0,   c128,     c128,    c128,     0,  "Commodore Business Machines Co.", "Commodore 128CR (NTSC, proto?)", 0)
961945
962COMP( 1985, c128sfi,   c128,  0,   c128pal,  c128fra, c128pal,  c128,  "Commodore Business Machines Co.", "Commodore 128 (PAL, Swedish / Finnish)", 0)
963COMP( 1985, c128fino,  c128,  0,   c128pal,  c128swe, c128pal,  c128,  "Commodore Business Machines Co.", "Commodore 128 (PAL, Finland, Unconfirmed Dumps)", 0)
964COMP( 1985, c128fra,   c128,  0,   c128pal,  c128fra, c128pal,  c128,  "Commodore Business Machines Co.", "Commodore 128 (PAL, France)", 0)
965COMP( 1985, c128ger,   c128,  0,   c128pal,  c128ger, c128pal,  c128,  "Commodore Business Machines Co.", "Commodore 128 (PAL, Germany)", 0)
966COMP( 1985, c128nor,   c128,  0,   c128pal,  c128ita, c128pal,  c128,  "Commodore Business Machines Co.", "Commodore 128 (PAL, Norway)", 0)
946COMP( 1985, c128sfi,   c128,  0,   c128pal,  c128fra, c128pal,  0,  "Commodore Business Machines Co.", "Commodore 128 (PAL, Swedish / Finnish)", 0)
947COMP( 1985, c128fino,  c128,  0,   c128pal,  c128swe, c128pal,  0,  "Commodore Business Machines Co.", "Commodore 128 (PAL, Finland, Unconfirmed Dumps)", 0)
948COMP( 1985, c128fra,   c128,  0,   c128pal,  c128fra, c128pal,  0,  "Commodore Business Machines Co.", "Commodore 128 (PAL, France)", 0)
949COMP( 1985, c128ger,   c128,  0,   c128pal,  c128ger, c128pal,  0,  "Commodore Business Machines Co.", "Commodore 128 (PAL, Germany)", 0)
950COMP( 1985, c128nor,   c128,  0,   c128pal,  c128ita, c128pal,  0,  "Commodore Business Machines Co.", "Commodore 128 (PAL, Norway)", 0)
967951// we miss other countries: Spain, Belgium, etc.
968952
969953// the following drivers use a 1571 floppy drive
970COMP( 1985, c128dpr,   c128,  0,   c128d,    c128,    c128d,    c128d, "Commodore Business Machines Co.", "Commodore 128D (NTSC, proto)", GAME_NOT_WORKING)
971COMP( 1985, c128d,     c128,  0,   c128dpal, c128,    c128dpal, c128d, "Commodore Business Machines Co.", "Commodore 128D (PAL)", GAME_NOT_WORKING)
954COMP( 1985, c128dpr,   c128,  0,   c128d,    c128,    c128d,    0, "Commodore Business Machines Co.", "Commodore 128D (NTSC, proto)", GAME_NOT_WORKING)
955COMP( 1985, c128d,     c128,  0,   c128dpal, c128,    c128dpal, 0, "Commodore Business Machines Co.", "Commodore 128D (PAL)", GAME_NOT_WORKING)
972956
973957// the following drivers use a 1571CR floppy drive
974COMP( 1986, c128dcr,   c128,  0,   c128dcr,  c128,    c128dcr,  c128d, "Commodore Business Machines Co.", "Commodore 128DCR (NTSC)", GAME_NOT_WORKING)
975COMP( 1986, c128drde,  c128,  0,   c128dcrp, c128ger, c128dcrp, c128d, "Commodore Business Machines Co.", "Commodore 128DCR (PAL, Germany)", GAME_NOT_WORKING)
976COMP( 1986, c128drit,  c128,  0,   c128dcrp, c128ita, c128dcrp, c128d, "Commodore Business Machines Co.", "Commodore 128DCR (PAL, Italy)", GAME_NOT_WORKING)
977COMP( 1986, c128drsw,  c128,  0,   c128dcrp, c128swe, c128dcrp, c128d, "Commodore Business Machines Co.", "Commodore 128DCR (PAL, Sweden)", GAME_NOT_WORKING)
958COMP( 1986, c128dcr,   c128,  0,   c128dcr,  c128,    c128dcr,  0, "Commodore Business Machines Co.", "Commodore 128DCR (NTSC)", GAME_NOT_WORKING)
959COMP( 1986, c128drde,  c128,  0,   c128dcrp, c128ger, c128dcrp, 0, "Commodore Business Machines Co.", "Commodore 128DCR (PAL, Germany)", GAME_NOT_WORKING)
960COMP( 1986, c128drit,  c128,  0,   c128dcrp, c128ita, c128dcrp, 0, "Commodore Business Machines Co.", "Commodore 128DCR (PAL, Italy)", GAME_NOT_WORKING)
961COMP( 1986, c128drsw,  c128,  0,   c128dcrp, c128swe, c128dcrp, 0, "Commodore Business Machines Co.", "Commodore 128DCR (PAL, Sweden)", GAME_NOT_WORKING)
978962
979963// the following driver is a c128 with 1581 floppy drive. it allows us to document 1581 firmware dumps, but it does not do much more
980COMP( 1986, c128d81,   c128,  0,   c128d81,  c128,    c128d81,  c128d81, "Commodore Business Machines Co.", "Commodore 128D/81 (NTSC, proto)", GAME_NOT_WORKING)
964COMP( 1986, c128d81,   c128,  0,   c128d81,  c128,    c128d81,  0, "Commodore Business Machines Co.", "Commodore 128D/81 (NTSC, proto)", GAME_NOT_WORKING)
src/mess/drivers/vc20.c
r6695r6696
250250{
251251   { "via6522_0" },
252252   { "via6522_1" },
253   { "c1540" },
253   { C1541_IEC("c1540") },
254254   { NULL}
255255};
256256
src/mess/drivers/c64.c
r6695r6696
482482static CBM_IEC_DAISY( cbm_iec_daisy )
483483{
484484   { "cia_1" },
485   { "c1541" },
485   { C1541_IEC("c1541") },
486486   { NULL}
487487};
488488

Previous 15994 Revisions Next


© 1998-2018 The MESS Team