Previous 15994 Revisions Next

r4770 Wednesday 20th May, 2009 at 13:23:35 UTC by Fabio Priuli
[CBM] Various cleanups:
* fixed crash when adding vc1541 MACHINE_DRIVER to c128d
* added a few machine parameters
* added a c64 MACHINE_RESET which will be useful later ;)
* correctly removed devices from MACHINE_DRIVERs where needed
* moved devices for floppy drives from base MACHINE_STARTs to drive MACHINE_STARTs (e.g. C64 VIAs), where they do belong
* changed some tags and replaced a few cpu numbers with tags
[src/mess/drivers]c128.c c16.c c64.c vc20.c
[src/mess/includes]c64.h cbm.h vc1541.h vc20.h
[src/mess/machine]c128.c c16.c c64.c cbmserb.c vc1541.c vc20.c

src/mess/includes/cbm.h
r4769r4770
5353#define CBM_ROM_ADDR_HI -2
5454
5555typedef struct {
56   int addr, size /*, bank*/;   // mi serve prob questo per implementare il corretto caricamento delle cart tipo >0!
56   int addr, size, index, start;
5757   UINT8 *chip;
5858} CBM_ROM;
5959
src/mess/includes/vc1541.h
r4769r4770
4949};
5050
5151
52int drive_config(running_machine *machine, int type, int id, int mode, int cpunr, int devicenr);
52int drive_config(running_machine *machine, int type, int id, int mode, const char *cputag, int devicenr);
5353void drive_reset(void);
5454
5555void vc1541_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
r4769r4770
186186/* serial bus for vic20, c64 & c16 with vc1541 and some printer */
187187
188188/* To be passed to serial bus emulation */
189void vc1541_serial_reset_write(int which,int level);
190int vc1541_serial_atn_read(int which);
191void vc1541_serial_atn_write(running_machine *machine, int which,int level);
192int vc1541_serial_data_read(int which);
193void vc1541_serial_data_write(int which,int level);
194int vc1541_serial_clock_read(int which);
195void vc1541_serial_clock_write(int which,int level);
196int vc1541_serial_request_read(int which);
197void vc1541_serial_request_write(int which,int level);
189void vc1541_serial_reset_write(running_machine *machine, int which, int level);
190int vc1541_serial_atn_read(running_machine *machine, int which);
191void vc1541_serial_atn_write(running_machine *machine, int which, int level);
192int vc1541_serial_data_read(running_machine *machine, int which);
193void vc1541_serial_data_write(running_machine *machine, int which, int level);
194int vc1541_serial_clock_read(running_machine *machine, int which);
195void vc1541_serial_clock_write(running_machine *machine, int which, int level);
196int vc1541_serial_request_read(running_machine *machine, int which);
197void vc1541_serial_request_write(running_machine *machine, int which, int level);
198198
199199
200200#endif /* VC1541_H_ */
src/mess/includes/vc20.h
r4769r4770
1919extern UINT8 *vc20_memory_9400;
2020extern const via6522_interface vc20_via0;
2121extern const via6522_interface vc20_via1;
22extern const via6522_interface vc20_via4;
23extern const via6522_interface vc20_via5;
22extern const via6522_interface vc20_via2;
23extern const via6522_interface vc20_via3;
2424
2525WRITE8_HANDLER ( vc20_write_9400 );
2626
src/mess/includes/c64.h
r4769r4770
3838DRIVER_INIT( sx64 );
3939
4040MACHINE_START( c64 );
41MACHINE_RESET( c64 );
4142INTERRUPT_GEN( c64_frame_interrupt );
4243TIMER_CALLBACK( c64_tape_timer );
4344
src/mess/machine/vc1541.c
r4769r4770
146146
147147
148148#define VERBOSE_LEVEL 0
149#define DBG_LOG(N,M,A) \
149#define DBG_LOG(MACHINE,N,M,A) \
150150   do { \
151151      if(VERBOSE_LEVEL >= N) \
152152      { \
153153         if( M ) \
154            logerror("%11.6f: %-24s", attotime_to_double(timer_get_time(machine)), (char*) M ); \
154            logerror("%11.6f: %-24s", attotime_to_double(timer_get_time(MACHINE)), (char*) M ); \
155155         logerror A; \
156156      } \
157157   } while (0)
r4769r4770
184184communications is a priority over the clean up of this part */
185185typedef struct
186186{
187   int cpunumber;
187   const char *cputag;
188188   int type;
189189   union {
190190      struct {
r4769r4770
297297
298298static const int max_tracks_per_format[] =
299299{
300D64_MAX_TRACKS,
301D64_MAX_TRACKS,
302D64_40T_MAX_TRACKS,
303D64_40T_MAX_TRACKS,
304D64_MAX_TRACKS,
305D71_MAX_TRACKS,
306D71_MAX_TRACKS,
307D81_MAX_TRACKS,
308D80_MAX_TRACKS,
309D82_MAX_TRACKS,
3100      /* Still to add support for .g64 */
300   D64_MAX_TRACKS,
301   D64_MAX_TRACKS,
302   D64_40T_MAX_TRACKS,
303   D64_40T_MAX_TRACKS,
304   D64_MAX_TRACKS,
305   D71_MAX_TRACKS,
306   D71_MAX_TRACKS,
307   D81_MAX_TRACKS,
308   D80_MAX_TRACKS,
309   D82_MAX_TRACKS,
310   0      /* Still to add support for .g64 */
311311};
312312
313313static int image_offset[IMAGE_MAX_TRACKS] = { 0 };
r4769r4770
576576
577577static ADDRESS_MAP_START( _1541_map, ADDRESS_SPACE_PROGRAM, 8 )
578578   AM_RANGE(0x0000, 0x07ff) AM_RAM
579   AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("via6522_2", via_r, via_w)   /* 0 and 1 used in vc20 */
580   AM_RANGE(0x1810, 0x189f) AM_READ(SMH_NOP)            /* for debugger */
581   AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("via6522_3", via_r, via_w)
582   AM_RANGE(0x1c10, 0x1c9f) AM_READ(SMH_NOP)            /* for debugger */
579   AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("_1541_via_0", via_r, via_w)   /* 0 and 1 used in vc20 */   // IEC Bus
580//   AM_RANGE(0x1810, 0x189f) AM_READ(SMH_NOP)            /* for debugger */
581   AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("_1541_via_1", via_r, via_w)      // Drive
582//   AM_RANGE(0x1c10, 0x1c9f) AM_READ(SMH_NOP)            /* for debugger */
583583   AM_RANGE(0xc000, 0xffff) AM_ROM
584584ADDRESS_MAP_END
585585
586586
587587static ADDRESS_MAP_START( dolphin_map, ADDRESS_SPACE_PROGRAM, 8 )
588588   AM_RANGE(0x0000, 0x07ff) AM_RAM
589   AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("via6522_2", via_r, via_w)   /* 0 and 1 used in vc20 */
590   AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("via6522_3", via_r, via_w)
589   AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("_1541_via_0", via_r, via_w)   /* 0 and 1 used in vc20 */
590   AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("_1541_via_1", via_r, via_w)
591591   AM_RANGE(0x8000, 0x9fff) AM_RAM
592592   AM_RANGE(0xa000, 0xffff) AM_ROM
593593ADDRESS_MAP_END
r4769r4770
604604   
605605      if (drive->type == type_1541)
606606      {
607         const device_config *via_3 = devtag_get_device(machine, "via6522_3");
607         const device_config *via_3 = devtag_get_device(machine, "_1541_via_1");
608608
609         cpu_set_input_line(machine->cpu[drive->cpunumber], M6502_SET_OVERFLOW, 1);
609         cputag_set_input_line(machine, drive->cputag, M6502_SET_OVERFLOW, 1);
610610         via_ca1_w(via_3, 0, 1);
611611      }
612612
r4769r4770
642642
643643   if (drive->type == type_1541)
644644   {
645      const device_config *via_3 = devtag_get_device(machine, "via6522_3");
646      cpu_set_input_line(machine->cpu[drive->cpunumber], M6502_SET_OVERFLOW, 0);
645      const device_config *via_3 = devtag_get_device(machine, "_1541_via_1");
646      cputag_set_input_line(machine, drive->cputag, M6502_SET_OVERFLOW, 0);
647647      via_ca1_w(via_3, 0, 0);
648648   }
649649
r4769r4770
667667 * irq to m6502 irq connected (or with second via irq)
668668 */
669669
670static void vc1541_via0_irq (const device_config *device, int level)
670static void vc1541_via0_irq(const device_config *device, int level)
671671{
672   running_machine *machine = device->machine;
673
674672   drive->via0irq = level;
675   DBG_LOG(2, "vc1541 via0 irq",("level %d %d\n",drive->via0irq,drive->via1irq));
673   DBG_LOG(device->machine, 2, "vc1541 via0 irq", ("level %d %d\n", drive->via0irq, drive->via1irq));
676674
677   cpu_set_input_line (device->machine->cpu[drive->cpunumber], M6502_IRQ_LINE, drive->via1irq || drive->via0irq);
675   cputag_set_input_line(device->machine, drive->cputag, M6502_IRQ_LINE, drive->via1irq || drive->via0irq);
678676}
679677
680678static READ8_DEVICE_HANDLER( vc1541_via0_read_portb )
r4769r4770
709707
710708static WRITE8_DEVICE_HANDLER( vc1541_via0_write_portb )
711709{
712   running_machine *machine = device->machine;
713
714   DBG_LOG(2, "vc1541 serial write",("%s %s %s\n",
710   DBG_LOG(device->machine, 2, "vc1541 serial write", ("%s %s %s\n",
715711                            data & 0x10 ? "ATN"   : "atn",
716712                            data & 0x08 ? "CLOCK" : "clock",
717713                            data & 0x02 ? "DATA"  : "data"));
r4769r4770
721717
722718   if ((!(data & 0x02)) != drive->drive.serial.serial_data)
723719   {
724      vc1541_serial_data_write (1, drive->drive.serial.serial_data = !(data & 0x02));
720      vc1541_serial_data_write(device->machine, 1, drive->drive.serial.serial_data = !(data & 0x02));
725721   }
726722
727723   if ((!(data & 0x08)) != drive->drive.serial.serial_clock)
728724   {
729      vc1541_serial_clock_write (1, drive->drive.serial.serial_clock = !(data & 0x08));
725      vc1541_serial_clock_write(device->machine, 1, drive->drive.serial.serial_clock = !(data & 0x08));
730726   }
731727
732   vc1541_serial_atn_write (device->machine, 1, drive->drive.serial.serial_atn = 1);
728   vc1541_serial_atn_write(device->machine, 1, drive->drive.serial.serial_atn = 1);
733729}
734730
735731
r4769r4770
763759
764760static void vc1541_via1_irq (const device_config *device, int level)
765761{
766   running_machine *machine = device->machine;
767
768762   drive->via1irq = level;
769   DBG_LOG(2, "vc1541 via1 irq", ("level %d %d\n", drive->via0irq, drive->via1irq));
763   DBG_LOG(device->machine, 2, "vc1541 via1 irq", ("level %d %d\n", drive->via0irq, drive->via1irq));
770764
771   cpu_set_input_line (machine->cpu[drive->cpunumber], M6502_IRQ_LINE, drive->via1irq || drive->via0irq);
765   cputag_set_input_line(device->machine, drive->cputag, M6502_IRQ_LINE, drive->via1irq || drive->via0irq);
772766}
773767
774768static READ8_DEVICE_HANDLER( vc1541_via1_read_porta )
775769{
776   running_machine *machine = device->machine;
777770   int data = drive->gcr.data[drive->pos];
778   DBG_LOG(2, "vc1541 drive", ("port a read %.2x\n", data));
771
772   DBG_LOG(device->machine, 2, "vc1541 drive", ("port a read %.2x\n", data));
779773   return data;
780774}
781775
782776static WRITE8_DEVICE_HANDLER( vc1541_via1_write_porta )
783777{
784   running_machine *machine = device->machine;
785   DBG_LOG(1, "vc1541 drive", ("port a write %.2x\n", data));
778   DBG_LOG(device->machine, 1, "vc1541 drive", ("port a write %.2x\n", data));
786779}
787780
788781static  READ8_DEVICE_HANDLER( vc1541_via1_read_portb )
r4769r4770
806799
807800static WRITE8_DEVICE_HANDLER( vc1541_via1_write_portb )
808801{
809   running_machine *machine = device->machine;
810802   if (data != old)
811803   {
812      DBG_LOG(1, "vc1541 drive",("%.2x\n", data));
804      DBG_LOG(device->machine, 1, "vc1541 drive",("%.2x\n", data));
813805
814806      if ((old & 0x03) != (data & 0x03))
815807      {
r4769r4770
844836            break;
845837         }
846838
847         logerror("Track #: %f\n", drive->track);
839//         logerror("Track #: %f\n", drive->track);
848840
849841         /* If we have reached the first or last track, we cannot proceed further! */
850842         if (drive->track < 1)
r4769r4770
889881{
890882}
891883
892const via6522_interface vc1541_via2 =
884const via6522_interface vc1541_via0 =
893885{
894886   DEVCB_NULL,                           /*vc1541_via0_read_porta, */
895887   DEVCB_HANDLER(vc1541_via0_read_portb),
r4769r4770
904896   DEVCB_NULL,                           /*via2_write_ca2, */
905897   DEVCB_NULL,                           /*via2_write_cb2, */
906898   DEVCB_LINE(vc1541_via0_irq)
907}, vc1541_via3 =
899},
900
901vc1541_via1 =
908902{
909903   DEVCB_HANDLER(vc1541_via1_read_porta),
910904   DEVCB_HANDLER(vc1541_via1_read_portb),
r4769r4770
922916};
923917
924918
925void vc1541_serial_reset_write (int which, int level)
919void vc1541_serial_reset_write( running_machine *machine, int which, int level )
926920{
927921}
928922
929int vc1541_serial_atn_read (int which)
923int vc1541_serial_atn_read( running_machine *machine, int which )
930924{
925/* there is no more cpu_getactivecpu! */
931926#ifdef CPU_SYNC
932927      if (cpu_getactivecpu()==0) cpu_sync();
933928#endif
934929   return serial.atn[0];
935930}
936931
937void vc1541_serial_atn_write (running_machine *machine, int which, int level)
932void vc1541_serial_atn_write( running_machine *machine, int which, int level )
938933{
939   const device_config *via_2 = devtag_get_device(machine, "via6522_2");
934   const device_config *via_2 = devtag_get_device(machine, "_1541_via_0");
940935#if 0
941936   int value;
942937#endif
943938   if (serial.atn[1 + which] != level)
944939   {
940/* there is no more cpu_getactivecpu! */
945941#ifdef CPU_SYNC
946942      if (cpu_getactivecpu()==0) cpu_sync();
947943#endif
r4769r4770
952948         if (serial.atn[0] == level)
953949         {
954950         #if 0
955            DBG_LOG(1, "vc1541",("%d:%.4x atn %s\n",
951            DBG_LOG(machine, 1, "vc1541",("%d:%.4x atn %s\n",
956952                            cpu_getactivecpu (),
957953                            activecpu_get_pc(),
958954                            serial.atn[0]?"ATN":"atn"));
r4769r4770
973969   }
974970}
975971
976int vc1541_serial_data_read (int which)
972int vc1541_serial_data_read( running_machine *machine, int which )
977973{
974/* there is no more cpu_getactivecpu! */
978975#ifdef CPU_SYNC
979976      if (cpu_getactivecpu()==0) cpu_sync();
980977#endif
981978   return serial.data[0];
982979}
983980
984void vc1541_serial_data_write (int which, int level)
981void vc1541_serial_data_write( running_machine *machine, int which, int level )
985982{
986983   if (serial.data[1 + which] != level)
987984   {
985/* there is no more cpu_getactivecpu! */
988986#ifdef CPU_SYNC
989987      if (cpu_getactivecpu()==0) cpu_sync();
990988#endif
r4769r4770
995993         #if 0
996994         if (serial.data[0] == level)
997995         {
998            DBG_LOG(1, "vc1541",("%d:%.4x data %s\n",
996            DBG_LOG(machine, 1, "vc1541",("%d:%.4x data %s\n",
999997                            cpu_getactivecpu (),
1000998                            activecpu_get_pc(),
1001999                            serial.data[0]?"DATA":"data"));
r4769r4770
10051003   }
10061004}
10071005
1008int vc1541_serial_clock_read (int which)
1006int vc1541_serial_clock_read( running_machine *machine, int which )
10091007{
1008/* there is no more cpu_getactivecpu! */
10101009#ifdef CPU_SYNC
10111010      if (cpu_getactivecpu()==0) cpu_sync();
10121011#endif
10131012   return serial.clock[0];
10141013}
10151014
1016void vc1541_serial_clock_write (int which, int level)
1015void vc1541_serial_clock_write( running_machine *machine, int which, int level )
10171016{
10181017   if (serial.clock[1 + which] != level)
10191018   {
1019/* there is no more cpu_getactivecpu! */
10201020#ifdef CPU_SYNC
10211021      if (cpu_getactivecpu()==0) cpu_sync();
10221022#endif
r4769r4770
10261026         serial.clock[0] = serial.clock[1] && serial.clock[2];
10271027         if (serial.clock[0] == level)
10281028         {
1029/*            DBG_LOG(1, "vc1541",("%d:%.4x clock %s\n",
1029/*            DBG_LOG(machine, 1, "vc1541",("%d:%.4x clock %s\n",
10301030                            cpu_getactivecpu (),
10311031                            activecpu_get_pc(),
10321032                            serial.clock[0]?"CLOCK":"clock"));*/
r4769r4770
10351035   }
10361036}
10371037
1038int vc1541_serial_request_read (int which)
1038int vc1541_serial_request_read( running_machine *machine, int which )
10391039{
10401040   return 1;
10411041}
10421042
1043void vc1541_serial_request_write (int which, int level)
1043void vc1541_serial_request_write( running_machine *machine, int which, int level )
10441044{
10451045}
10461046
r4769r4770
10531053
10541054static ADDRESS_MAP_START( _1571_map, ADDRESS_SPACE_PROGRAM, 8 )
10551055   AM_RANGE(0x0000, 0x07ff) AM_RAM
1056   AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("via6522_2", via_r, via_w)  /* 0 and 1 used in vc20 */
1056   AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("_1541_via_0", via_r, via_w)  /* 0 and 1 used in vc20 */
10571057   AM_RANGE(0x1810, 0x189f) AM_READ(SMH_NOP) /* for debugger */
1058   AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("via6522_3", via_r, via_w)
1058   AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("_1541_via_1", via_r, via_w)
10591059   AM_RANGE(0x1c10, 0x1c9f) AM_READ(SMH_NOP) /* for debugger */
10601060//   AM_RANGE(0x2000, 0x2003) // WD17xx
10611061//   AM_RANGE(0x4000, 0x400f) // CIA
r4769r4770
11001100 */
11011101static TIMER_CALLBACK(c1551_irq_timer)
11021102{
1103   cpu_set_input_line(machine->cpu[drive->cpunumber], M6502_IRQ_LINE, ASSERT_LINE);
1103   cputag_set_input_line(machine, drive->cputag, M6502_IRQ_LINE, ASSERT_LINE);
11041104}
11051105
11061106/*
r4769r4770
11131113  7: input byte ready
11141114 */
11151115
1116static WRITE8_HANDLER ( c1551_port_w )
1116static WRITE8_HANDLER( c1551_port_w )
11171117{
1118   running_machine *machine = space->machine;
11191118   if (offset)
11201119   {
1121      DBG_LOG(1, "c1551 port",("write %.2x\n", data));
1120      DBG_LOG(space->machine, 1, "c1551 port",("write %.2x\n", data));
11221121      drive->drive.c1551.cpu_port = data;
11231122
11241123      if (data != old)
11251124      {
1126         DBG_LOG(1, "vc1541 drive",("%.2x\n", data));
1125         DBG_LOG(space->machine, 1, "vc1541 drive",("%.2x\n", data));
11271126     
11281127         if ((old & 0x03) != (data & 0x03))
11291128         {
r4769r4770
11911190   else
11921191   {
11931192      drive->drive.c1551.cpu_ddr = data;
1194      DBG_LOG(1, "c1551 ddr", ("write %.2x\n", data));
1193      DBG_LOG(space->machine, 1, "c1551 ddr", ("write %.2x\n", data));
11951194   }
11961195}
11971196
1198static READ8_HANDLER ( c1551_port_r )
1197static READ8_HANDLER( c1551_port_r )
11991198{
1200   running_machine *machine = space->machine;
12011199   int data;
12021200
12031201   if (offset)
r4769r4770
12151213
12161214      data &= ~drive->drive.c1551.cpu_ddr;
12171215      data |= drive->drive.c1551.cpu_ddr & drive->drive.c1551.cpu_port;
1218      DBG_LOG(3, "c1551 port",("read %.2x\n", data));
1216      DBG_LOG(space->machine, 3, "c1551 port",("read %.2x\n", data));
12191217   }
12201218   else
12211219   {
12221220      data = drive->drive.c1551.cpu_ddr;
1223      DBG_LOG(3, "c1551 ddr",("read %.2x\n", data));
1221      DBG_LOG(space->machine, 3, "c1551 ddr",("read %.2x\n", data));
12241222   }
12251223   return data;
12261224}
r4769r4770
12551253
12561254static READ8_DEVICE_HANDLER( c1551_port_b_r )
12571255{
1258   running_machine *machine = device->machine;
12591256   int data = drive->gcr.data[drive->pos];
1260   DBG_LOG(2, "c1551 drive",("port a read %.2x\n", data));
1257
1258   DBG_LOG(device->machine, 2, "c1551 drive",("port a read %.2x\n", data));
12611259   return data;
12621260}
12631261
r4769r4770
12721270
12731271WRITE8_DEVICE_HANDLER( c1551x_write_data )
12741272{
1275//   DBG_LOG(1, "c1551 cpu", ("%d write data %.2x\n", cpu_getactivecpu (), data));
1273//   DBG_LOG(device->machine, 1, "c1551 cpu", ("%d write data %.2x\n", cpu_getactivecpu (), data));
12761274#ifdef CPU_SYNC
12771275   cpu_sync();
12781276#endif
r4769r4770
12871285#endif
12881286
12891287   data = tpi6525_porta_r(device, 0);
1290//   DBG_LOG(2, "c1551 cpu",("%d read data %.2x\n", cpu_getactivecpu (), data));
1288//   DBG_LOG(device->machine, 2, "c1551 cpu",("%d read data %.2x\n", cpu_getactivecpu (), data));
12911289   return data;
12921290}
12931291
12941292WRITE8_DEVICE_HANDLER( c1551x_write_handshake )
12951293{
1296//   DBG_LOG(1, "c1551 cpu",("%d write handshake %.2x\n", cpu_getactivecpu (), data));
1294//   DBG_LOG(device->machine, 1, "c1551 cpu",("%d write handshake %.2x\n", cpu_getactivecpu (), data));
12971295#ifdef CPU_SYNC
12981296   cpu_sync();
12991297#endif
r4769r4770
13091307#endif
13101308
13111309   data = tpi6525_portc_r(device, 0) & 0x08 ? 0x80 : 0x00;
1312//   DBG_LOG(2, "c1551 cpu",("%d read handshake %.2x\n", cpu_getactivecpu (), data));
1310//   DBG_LOG(device->machine, 2, "c1551 cpu",("%d read handshake %.2x\n", cpu_getactivecpu (), data));
13131311   return data;
13141312}
13151313
r4769r4770
13211319#endif
13221320
13231321   data = tpi6525_portc_r(device, 0) & 0x03;
1324//   DBG_LOG(1, "c1551 cpu",("%d read status %.2x\n", cpu_getactivecpu (), data));
1322//   DBG_LOG(device->machine, 1, "c1551 cpu",("%d read status %.2x\n", cpu_getactivecpu (), data));
13251323
13261324   return data;
13271325}
r4769r4770
13331331
13341332**************************************/
13351333
1336int drive_config (running_machine *machine, int type, int id, int mode, int cpunr, int devicenr)
1334int drive_config( running_machine *machine, int type, int id, int mode, const char *cputag, int devicenr )
13371335{
13381336   drive->type = type;
1339   drive->cpunumber = cpunr;
1337   drive->cputag = cputag;
13401338   drive->drive.serial.deviceid = devicenr;
13411339   drive->timer = timer_alloc(machine, drive_timer, NULL);
13421340
r4769r4770
13901388MACHINE_DRIVER_START( cpu_vc1540 )
13911389   MDRV_CPU_ADD("cpu_vc1540", M6502, XTAL_16_MHz / 16)
13921390   MDRV_CPU_PROGRAM_MAP(_1541_map)
1391
1392   MDRV_VIA6522_ADD("_1541_via_0", 0, vc1541_via0)
1393   MDRV_VIA6522_ADD("_1541_via_1", 0, vc1541_via1)
13931394MACHINE_DRIVER_END
13941395
13951396MACHINE_DRIVER_START( cpu_vc1541 )
r4769r4770
14161417MACHINE_DRIVER_START( cpu_c1571 )
14171418   MDRV_CPU_ADD("cpu_vc1540", M6502, XTAL_16_MHz / 16)
14181419   MDRV_CPU_PROGRAM_MAP(_1571_map)
1420
1421   MDRV_VIA6522_ADD("_1541_via_0", 0, vc1541_via0)
1422   MDRV_VIA6522_ADD("_1541_via_1", 0, vc1541_via1)
14191423MACHINE_DRIVER_END
14201424
14211425
src/mess/machine/c128.c
r4769r4770
11371137{
11381138   c64_tape_on = 1;
11391139   c128_common_driver_init(machine);
1140   vic6567_init (1, c64_pal, c128_dma_read, c128_dma_read_color, c128_vic_interrupt);
1140   vic6567_init(1, c64_pal, c128_dma_read, c128_dma_read_color, c128_vic_interrupt);
11411141   vic2_set_rastering(0);
11421142   vdc8563_init(0);
11431143   vdc8563_set_rastering(1);
r4769r4770
11481148   c64_tape_on = 1;
11491149   c64_pal = 1;
11501150   c128_common_driver_init(machine);
1151   vic6567_init (1, c64_pal, c128_dma_read, c128_dma_read_color, c128_vic_interrupt);
1151   vic6567_init(1, c64_pal, c128_dma_read, c128_dma_read_color, c128_vic_interrupt);
11521152   vic2_set_rastering(1);
11531153   vdc8563_init(0);
11541154   vdc8563_set_rastering(0);
r4769r4770
11571157DRIVER_INIT( c128d )
11581158{
11591159   DRIVER_INIT_CALL( c128 );
1160//   drive_config (machine, type_1541, 0, 0, 1, 8);
1160   drive_config(machine, type_1541, 0, 0, "cpu_vc1540", 8);
11611161}
11621162
11631163DRIVER_INIT( c128dpal )
11641164{
11651165   DRIVER_INIT_CALL( c128d );
1166//   drive_config (machine, type_1541, 0, 0, 1, 8);
1166   drive_config(machine, type_1541, 0, 0, "cpu_vc1540", 8);
11671167}
11681168
11691169MACHINE_START( c128 )
r4769r4770
11711171   if (c128_cia1_on)
11721172   {
11731173      cbm_serial_config(machine, &cbm_sim_drive_interface);
1174      cbm_serial_reset_write (machine, 0);
1175      cbm_drive_0_config (SERIAL, 8);
1176      cbm_drive_1_config (SERIAL, 9);
1174      cbm_serial_reset_write(machine, 0);
1175      cbm_drive_0_config(SERIAL, 8);
1176      cbm_drive_1_config(SERIAL, 9);
11771177      serial_clock = serial_data = serial_atn = 1;
11781178   }
11791179
src/mess/machine/c16.c
r4769r4770
457457   memset(mess_ram + (0xfd40 % mess_ram_size), 0xff, 0x20);
458458   
459459   if (has_c1551)      /* C1551 */
460      drive_config(machine, type_1551, 0, 0, 1, 8);
460      drive_config(machine, type_1551, 0, 0, "cpu_c1551", 8);
461461
462462   if (has_vc1541)      /* VC1541 */
463      drive_config(machine, type_1541, 0, 0, 1, 8);
463      drive_config(machine, type_1541, 0, 0, "cpu_vc1540", 8);
464464}
465465
466466static void c16_driver_init(running_machine *machine)
467467{
468   c16_common_driver_init (machine);
469   ted7360_init (machine, (read_cfg1(machine) & 0x10 ) == 0x00);      /* is it PAL? */
470   ted7360_set_dma (ted7360_dma_read, ted7360_dma_read_rom);
468   c16_common_driver_init(machine);
469   ted7360_init(machine, (read_cfg1(machine) & 0x10 ) == 0x00);      /* is it PAL? */
470   ted7360_set_dma(ted7360_dma_read, ted7360_dma_read_rom);
471471}
472472
473473
src/mess/machine/cbmserb.c
r4769r4770
138138
139139static void emu_drive_reset_write( running_machine *machine, int level )
140140{
141   vc1541_serial_reset_write(0, level);
141   vc1541_serial_reset_write(machine, 0, level);
142142}
143143
144144static int emu_drive_request_read( running_machine *machine )   
145145{
146   return vc1541_serial_request_read(0);
146   return vc1541_serial_request_read(machine, 0);
147147}
148148   
149149static void emu_drive_request_write( running_machine *machine, int level )
150150{
151   vc1541_serial_request_write(0, level);
151   vc1541_serial_request_write(machine, 0, level);
152152}
153153
154154static int emu_drive_atn_read( running_machine *machine )
155155{
156   return vc1541_serial_atn_read(0);
156   return vc1541_serial_atn_read(machine, 0);
157157}
158158
159159static int emu_drive_data_read( running_machine *machine )
160160{
161   return vc1541_serial_data_read(0);
161   return vc1541_serial_data_read(machine, 0);
162162}
163163
164164static int emu_drive_clock_read( running_machine *machine )
165165{
166   return vc1541_serial_clock_read(0);
166   return vc1541_serial_clock_read(machine, 0);
167167}
168168
169169static void emu_drive_atn_write( running_machine *machine, int level )
r4769r4770
173173
174174static void emu_drive_data_write( running_machine *machine, int level )
175175{
176   vc1541_serial_data_write(0, level);
176   vc1541_serial_data_write(machine, 0, level);
177177}
178178
179179static void emu_drive_clock_write( running_machine *machine, int level )
180180{
181   vc1541_serial_clock_write(0, level);
181   vc1541_serial_clock_write(machine, 0, level);
182182}
183183
184184const cbm_serial_interface cbm_emu_drive_interface =
src/mess/machine/vc20.c
r4769r4770
351351  6 ndac in
352352  7 atn in
353353 */
354static READ8_DEVICE_HANDLER( vc20_via4_read_portb )
354static READ8_DEVICE_HANDLER( vc20_via2_read_portb )
355355{
356356   UINT8 data = 0;
357357   if (cbm_ieee_eoi_r(device->machine)) data |= 0x08;
r4769r4770
362362   return data;
363363}
364364
365static WRITE8_DEVICE_HANDLER( vc20_via4_write_portb )
365static WRITE8_DEVICE_HANDLER( vc20_via2_write_portb )
366366{
367367   cbm_ieee_dav_w(device->machine, 0, data & 0x01);
368368   cbm_ieee_nrfd_w(device->machine, 0, data & 0x02);
r4769r4770
376376   cb2 eoi out
377377   ca2 atn out
378378*/
379static WRITE8_DEVICE_HANDLER( vc20_via5_write_porta )
379static WRITE8_DEVICE_HANDLER( vc20_via3_write_porta )
380380{
381381   cbm_ieee_data_w(device->machine, 0, data);
382382}
383383
384static READ8_DEVICE_HANDLER( vc20_via5_read_portb )
384static READ8_DEVICE_HANDLER( vc20_via3_read_portb )
385385{
386386   return cbm_ieee_data_r(device->machine);
387387}
388388
389static WRITE8_DEVICE_HANDLER( vc20_via5_write_ca2 )
389static WRITE8_DEVICE_HANDLER( vc20_via3_write_ca2 )
390390{
391391   cbm_ieee_atn_w(device->machine, 0, data);
392392}
393393
394static READ8_DEVICE_HANDLER( vc20_via5_read_cb1 )
394static READ8_DEVICE_HANDLER( vc20_via3_read_cb1 )
395395{
396396   return cbm_ieee_srq_r(device->machine);
397397}
398398
399static WRITE8_DEVICE_HANDLER( vc20_via5_write_cb2 )
399static WRITE8_DEVICE_HANDLER( vc20_via3_write_cb2 )
400400{
401401   cbm_ieee_eoi_w(device->machine, 0, data);
402402}
r4769r4770
416416   DEVCB_HANDLER(vc20_via0_write_ca2),
417417   DEVCB_NULL,                           /*via0_write_cb2, */
418418   DEVCB_LINE(vc20_via0_irq)
419}, vc20_via1 =
419},
420
421vc20_via1 =
420422{
421423   DEVCB_HANDLER(vc20_via1_read_porta),
422424   DEVCB_HANDLER(vc20_via1_read_portb),
r4769r4770
432434   DEVCB_HANDLER(vc20_via1_write_cb2),
433435   DEVCB_LINE(vc20_via1_irq)
434436},
435/* via2,3 used by vc1541 and 2031 disk drives */
436vc20_via4 =
437
438vc20_via2 =
437439{
438   DEVCB_NULL, /*vc20_via4_read_porta, */
439   DEVCB_HANDLER(vc20_via4_read_portb),
440   DEVCB_NULL, /*vc20_via4_read_ca1, */
441   DEVCB_NULL, /*vc20_via5_read_cb1, */
440   DEVCB_NULL, /*vc20_via2_read_porta, */
441   DEVCB_HANDLER(vc20_via2_read_portb),
442   DEVCB_NULL, /*vc20_via2_read_ca1, */
443   DEVCB_NULL, /*vc20_via2_read_cb1, */
442444   DEVCB_NULL, /* via1_read_ca2 */
443445   DEVCB_NULL,                           /*via1_read_cb2, */
444446   DEVCB_NULL,                           /*via1_write_porta, */
445   DEVCB_HANDLER(vc20_via4_write_portb),
447   DEVCB_HANDLER(vc20_via2_write_portb),
446448   DEVCB_NULL,                                 /*via0_write_ca1, */
447449   DEVCB_NULL,                                 /*via0_write_cb1, */
448   DEVCB_NULL, /*vc20_via5_write_ca2, */
449   DEVCB_NULL, /*vc20_via5_write_cb2, */
450   DEVCB_NULL, /*vc20_via2_write_ca2, */
451   DEVCB_NULL, /*vc20_via2_write_cb2, */
450452   DEVCB_LINE(vc20_via1_irq)
451}, vc20_via5 =
453},
454
455vc20_via3 =
452456{
453   DEVCB_NULL,/*vc20_via5_read_porta, */
454   DEVCB_HANDLER(vc20_via5_read_portb),
455   DEVCB_NULL, /*vc20_via5_read_ca1, */
456   DEVCB_HANDLER(vc20_via5_read_cb1),
457   DEVCB_NULL,/*vc20_via3_read_porta, */
458   DEVCB_HANDLER(vc20_via3_read_portb),
459   DEVCB_NULL, /*vc20_via3_read_ca1, */
460   DEVCB_HANDLER(vc20_via3_read_cb1),
457461   DEVCB_NULL,                           /*via1_read_ca2, */
458462   DEVCB_NULL,                           /*via1_read_cb2, */
459   DEVCB_HANDLER(vc20_via5_write_porta),
460   DEVCB_NULL,/*vc20_via5_write_portb, */
463   DEVCB_HANDLER(vc20_via3_write_porta),
464   DEVCB_NULL,/*vc20_via3_write_portb, */
461465   DEVCB_NULL,                                 /*via0_write_ca1, */
462466   DEVCB_NULL,                                 /*via0_write_cb1, */
463   DEVCB_HANDLER(vc20_via5_write_ca2),
464   DEVCB_HANDLER(vc20_via5_write_cb2),
467   DEVCB_HANDLER(vc20_via3_write_ca2),
468   DEVCB_HANDLER(vc20_via3_write_cb2),
465469   DEVCB_LINE(vc20_via1_irq)
466470};
467471
r4769r4770
485489
486490WRITE8_HANDLER( vc20_0400_w )
487491{
488   if ( mess_ram_size >= 8 * 1024 )
492   if (mess_ram_size >= 8 * 1024)
489493   {
490      mess_ram[ 0x0400 + offset ] = data;
494      mess_ram[0x0400 + offset] = data;
491495   }
492496}
493497
494498WRITE8_HANDLER( vc20_2000_w )
495499{
496   if ( ( mess_ram_size >= 16 * 1024 ) && vc20_rom_2000 == NULL )
500   if ((mess_ram_size >= 16 * 1024) && vc20_rom_2000 == NULL)
497501   {
498      mess_ram[ 0x2000 + offset ] = data;
502      mess_ram[0x2000 + offset] = data;
499503   }
500504}
501505
502506WRITE8_HANDLER( vc20_4000_w )
503507{
504   if ( ( mess_ram_size >= 24 * 1024 ) && vc20_rom_4000 == NULL )
508   if ((mess_ram_size >= 24 * 1024) && vc20_rom_4000 == NULL)
505509   {
506      mess_ram[ 0x4000 + offset ] = data;
510      mess_ram[0x4000 + offset] = data;
507511   }
508512}
509513
510514WRITE8_HANDLER( vc20_6000_w )
511515{
512   if ( ( mess_ram_size >= 32 * 1024 ) && vc20_rom_6000 == NULL )
516   if ((mess_ram_size >= 32 * 1024) && vc20_rom_6000 == NULL)
513517   {
514      mess_ram[ 0x6000 + offset ] = data;
518      mess_ram[0x6000 + offset] = data;
515519   }
516520}
517521
r4769r4770
538542   /* 2114 poweron ? 64 x 0xff, 64x 0, and so on */
539543   for (i = 0; i < 0x400; i += 0x40)
540544   {
541      memset (memory + i, i & 0x40 ? 0 : 0xff, 0x40);
542      memset (memory + 0x9400 + i, 0xf0 | (i & 0x40 ? 0 : 0xf), 0x40);
545      memset(memory + i, i & 0x40 ? 0 : 0xff, 0x40);
546      memset(memory + 0x9400 + i, 0xf0 | (i & 0x40 ? 0 : 0xf), 0x40);
543547   }
544548   // this would be the straight forward memory init for
545549   // non cost reduced vic20 (2114 rams)
r4769r4770
548552#endif
549553
550554   /* clears ieee cartrige rom */
551   /* memset (memory + 0xa000, 0xff, 0x2000); */
555   /* memset(memory + 0xa000, 0xff, 0x2000); */
552556
553557   inited = 1;
554558}
r4769r4770
561565   via_ca1_w(via_1, 0, data);
562566}
563567
564static void vc20_common_driver_init (running_machine *machine)
568static void vc20_common_driver_init( running_machine *machine )
565569{
566570   vc20_memory_init(machine);
567571
568572   datasette_timer = timer_alloc(machine, vic20_tape_timer, NULL);
569573
570574   if (has_vc1541)
571      drive_config (machine, type_1541, 0, 0, 1, 8);
575      drive_config(machine, type_1541, 0, 0, "cpu_vc1540", 8);
572576}
573577
574578DRIVER_INIT( vc20 )
575579{
576   vc20_common_driver_init (machine);
577   vic6561_init (vic6560_dma_read, vic6560_dma_read_color);
580   vc20_common_driver_init(machine);
581   vic6561_init(vic6560_dma_read, vic6560_dma_read_color);
578582}
579583
580584DRIVER_INIT( vic20 )
581585{
582   vc20_common_driver_init (machine);
583   vic6560_init (vic6560_dma_read, vic6560_dma_read_color);
586   vc20_common_driver_init(machine);
587   vic6560_init(vic6560_dma_read, vic6560_dma_read_color);
584588}
585589
586590DRIVER_INIT( vic1001 )
r4769r4770
591595DRIVER_INIT( vc20v )
592596{
593597   has_vc1541 = 1;
594   vc20_common_driver_init (machine);
595   vic6561_init (vic6560_dma_read, vic6560_dma_read_color);
598   vc20_common_driver_init(machine);
599   vic6561_init(vic6560_dma_read, vic6560_dma_read_color);
596600}
597601
598602DRIVER_INIT( vic20v )
599603{
600604   has_vc1541 = 1;
601   vc20_common_driver_init (machine);
602   vic6560_init (vic6560_dma_read, vic6560_dma_read_color);
605   vc20_common_driver_init(machine);
606   vic6560_init(vic6560_dma_read, vic6560_dma_read_color);
603607}
604608
605609DRIVER_INIT( vic20i )
606610{
607611   ieee = 1;
608   vc20_common_driver_init (machine);
609   vic6560_init (vic6560_dma_read, vic6560_dma_read_color);
612   vc20_common_driver_init(machine);
613   vic6560_init(vic6560_dma_read, vic6560_dma_read_color);
610614   cbm_ieee_open();
611615}
612616
r4769r4770
617621   if (has_vc1541)
618622   {
619623      cbm_serial_config(machine, &cbm_fake_drive_interface);
620      drive_reset ();
624      drive_reset();
621625   }
622626   else
623627   {
624628      cbm_serial_config(machine, &cbm_sim_drive_interface);
625      cbm_serial_reset_write (machine, 0);
629      cbm_serial_reset_write(machine, 0);
626630
627631      if (ieee)
628632      {
629         cbm_drive_0_config (IEEE, 8);
630         cbm_drive_1_config (IEEE, 9);
633         cbm_drive_0_config(IEEE, 8);
634         cbm_drive_1_config(IEEE, 9);
631635      }
632636      else
633637      {
634         cbm_drive_0_config (SERIAL, 8);
635         cbm_drive_1_config (SERIAL, 9);
638         cbm_drive_0_config(SERIAL, 8);
639         cbm_drive_1_config(SERIAL, 9);
636640      }
637641   }
638642
src/mess/machine/c64.c
r4769r4770
814814      datasette_timer = timer_alloc(machine, c64_tape_timer, NULL);
815815
816816   if (ultimax)
817      vic6567_init (0, c64_pal, c64_dma_read_ultimax, c64_dma_read_color, c64_vic_interrupt);
817      vic6567_init(0, c64_pal, c64_dma_read_ultimax, c64_dma_read_color, c64_vic_interrupt);
818818   else
819      vic6567_init (0, c64_pal, c64_dma_read, c64_dma_read_color, c64_vic_interrupt);
819      vic6567_init(0, c64_pal, c64_dma_read, c64_dma_read_color, c64_vic_interrupt);
820820}
821821
822822DRIVER_INIT( c64 )
823823{
824   c64_common_driver_init (machine);
824   c64_common_driver_init(machine);
825825}
826826
827827DRIVER_INIT( c64pal )
828828{
829829   c64_pal = 1;
830   c64_common_driver_init (machine);
830   c64_common_driver_init(machine);
831831}
832832
833833DRIVER_INIT( ultimax )
834834{
835835   ultimax = 1;
836836    c64_cia1_on = 0;
837   c64_common_driver_init (machine);
837   c64_common_driver_init(machine);
838838}
839839
840840DRIVER_INIT( c64gs )
r4769r4770
842842   c64_pal = 1;
843843   c64_tape_on = 0;
844844    c64_cia1_on = 1;
845   c64_common_driver_init (machine);
845   c64_common_driver_init(machine);
846846}
847847
848848DRIVER_INIT( sx64 )
r4769r4770
850850   is_sx64 = 1;
851851   c64_tape_on = 0;
852852   c64_pal = 1;
853   c64_common_driver_init (machine);
854   drive_config (machine, type_1541, 0, 0, 1, 8);
853   c64_common_driver_init(machine);
854   drive_config(machine, type_1541, 0, 0, "cpu_vc1540", 8);
855855}
856856
857857static void c64_common_init_machine (running_machine *machine)
r4769r4770
865865   else if (c64_cia1_on)
866866   {
867867      cbm_serial_config(machine, &cbm_sim_drive_interface);
868      cbm_serial_reset_write (machine, 0);
869      cbm_drive_0_config (SERIAL, 8);
870      cbm_drive_1_config (SERIAL, 9);
868      cbm_serial_reset_write(machine, 0);
869      cbm_drive_0_config(SERIAL, 8);
870      cbm_drive_1_config(SERIAL, 9);
871871      serial_clock = serial_data = serial_atn = 1;
872872   }
873873
r4769r4770
879879{
880880   c64_port_data = 0x17;
881881
882   c64_io_mirror = auto_alloc_array(machine, UINT8, 0x1000 );
883   c64_common_init_machine (machine);
882   c64_io_mirror = auto_alloc_array(machine, UINT8, 0x1000);
883   c64_common_init_machine(machine);
884884
885885   if (!ultimax)
886886      c64_bankswitch(machine, 1);
887887}
888888
889MACHINE_RESET( c64 )
890{
891}
889892
890893INTERRUPT_GEN( c64_frame_interrupt )
891894{
src/mess/drivers/c128.c
r4769r4770
641641
642642static MACHINE_DRIVER_START( c128d )
643643   MDRV_IMPORT_FROM( c128 )
644//   MDRV_IMPORT_FROM( cpu_c1571 )
644   MDRV_IMPORT_FROM( cpu_c1571 )
645645MACHINE_DRIVER_END
646646
647647
r4769r4770
668668
669669static MACHINE_DRIVER_START( c128dpal )
670670   MDRV_IMPORT_FROM( c128pal )
671//   MDRV_IMPORT_FROM( cpu_c1571 )
671   MDRV_IMPORT_FROM( cpu_c1571 )
672672MACHINE_DRIVER_END
673673
674674
src/mess/drivers/c16.c
r4769r4770
449449   /* cassette */
450450   MDRV_CASSETTE_ADD( "cassette", cbm_cassette_config )
451451
452   /* via */
453   MDRV_VIA6522_ADD("via6522_2", 0, vc1541_via2)
454   MDRV_VIA6522_ADD("via6522_3", 0, vc1541_via3)
455
456452   /* tpi */
457453   MDRV_TPI6525_ADD("tpi6535_tpi_2", c16_tpi6525_tpi_2_intf)
458454   MDRV_TPI6525_ADD("tpi6535_tpi_3", c16_tpi6525_tpi_3_intf)
r4769r4770
464460static MACHINE_DRIVER_START( c16c )
465461   MDRV_IMPORT_FROM( c16 )
466462
467   // Need to check this since c16c is only using tpi_2
468   //MDRV_TPI6525_REMOVE("tpi6535_tpi_2")
469   //MDRV_TPI6525_ADD("tpi6535_tpi_2", c16_tpi6525_tpi_2_c1551_intf)
463   /* c16c uses 'real' floppy drive emulation from machine/vc1541.c...
464   still in progress and slow as hell, atm */
465   /* by default, it is also disabled atm => no floppies for c16c. it will be fixed */
466   MDRV_TPI6525_REMOVE("tpi6535_tpi_2")
467   MDRV_TPI6525_ADD("tpi6535_tpi_2", c16_tpi6525_tpi_2_c1551_intf)
470468
469   /* emulation code currently supports only one drive */
470   MDRV_TPI6525_REMOVE("tpi6535_tpi_3")
471
471472   MDRV_IMPORT_FROM( cpu_c1551 )
472473#ifdef CPU_SYNC
473474   MDRV_QUANTUM_TIME(HZ(60))
r4769r4770
485486#else
486487   MDRV_QUANTUM_TIME(HZ(300000))
487488#endif
489
490   /* no c1551 in this driver */
491   MDRV_TPI6525_REMOVE("tpi6535_tpi_2")
492   MDRV_TPI6525_REMOVE("tpi6535_tpi_3")
488493MACHINE_DRIVER_END
489494
490495
r4769r4770
502507
503508static MACHINE_DRIVER_START( plus4c )
504509   MDRV_IMPORT_FROM( plus4 )
510
511   /* plus4c uses 'real' floppy drive emulation from machine/vc1541.c...
512   still in progress and slow as hell, atm */
513   /* by default, it is also disabled atm => no floppies for plus4c. it will be fixed */
514   MDRV_TPI6525_REMOVE("tpi6535_tpi_2")
515   MDRV_TPI6525_ADD("tpi6535_tpi_2", c16_tpi6525_tpi_2_c1551_intf)
516
517   /* emulation code currently supports only one drive */
518   MDRV_TPI6525_REMOVE("tpi6535_tpi_3")
519
505520   MDRV_IMPORT_FROM( cpu_c1551 )
521
506522   MDRV_SCREEN_MODIFY("screen")
507523   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
508524#ifdef CPU_SYNC
r4769r4770
524540#else
525541   MDRV_QUANTUM_TIME(HZ(300000))
526542#endif
543
544   /* no c1551 in this driver */
545   MDRV_TPI6525_REMOVE("tpi6535_tpi_2")
546   MDRV_TPI6525_REMOVE("tpi6535_tpi_3")
527547MACHINE_DRIVER_END
528548
529549
src/mess/drivers/vc20.c
r4769r4770
137137   AM_RANGE(0x9110, 0x911f) AM_DEVREADWRITE("via6522_0", via_r, via_w)
138138   AM_RANGE(0x9120, 0x912f) AM_DEVREADWRITE("via6522_1", via_r, via_w)
139139   AM_RANGE(0x9400, 0x97ff) AM_READWRITE( SMH_RAM, vc20_write_9400) AM_BASE(&vc20_memory_9400)   /* color ram 4 bit */
140   AM_RANGE(0x9800, 0x980f) AM_DEVREADWRITE("via6522_4", via_r, via_w)
141   AM_RANGE(0x9810, 0x981f) AM_DEVREADWRITE("via6522_5", via_r, via_w)
140   AM_RANGE(0x9800, 0x980f) AM_DEVREADWRITE("via6522_2", via_r, via_w)
141   AM_RANGE(0x9810, 0x981f) AM_DEVREADWRITE("via6522_3", via_r, via_w)
142142   AM_RANGE(0xa000, 0xbfff) AM_ROMBANK(5)
143143   AM_RANGE(0xc000, 0xffff) AM_ROM
144144ADDRESS_MAP_END
r4769r4770
290290   /* via */
291291   MDRV_VIA6522_ADD("via6522_0", 0, vc20_via0)
292292   MDRV_VIA6522_ADD("via6522_1", 0, vc20_via1)
293   MDRV_VIA6522_ADD("via6522_2", 0, vc1541_via2)
294   MDRV_VIA6522_ADD("via6522_3", 0, vc1541_via3)
295   MDRV_VIA6522_ADD("via6522_4", 0, vc20_via4)
296   MDRV_VIA6522_ADD("via6522_5", 0, vc20_via5)
293   MDRV_VIA6522_ADD("via6522_2", 0, vc20_via2)
294   MDRV_VIA6522_ADD("via6522_3", 0, vc20_via3)
297295   
298296   MDRV_IMPORT_FROM(vic20_cartslot)
299297MACHINE_DRIVER_END
src/mess/drivers/c64.c
r4769r4770
494494   MDRV_QUANTUM_TIME(HZ(60))
495495
496496   MDRV_MACHINE_START( c64 )
497   MDRV_MACHINE_RESET( c64 )
497498
498499   /* video hardware */
499500   MDRV_IMPORT_FROM( vh_vic2 )
r4769r4770
519520   MDRV_CIA6526_ADD("cia_0", CIA6526R1, VIC6567_CLOCK, c64_ntsc_cia0)
520521   MDRV_CIA6526_ADD("cia_1", CIA6526R1, VIC6567_CLOCK, c64_ntsc_cia1)
521522
522   /* via */
523   MDRV_VIA6522_ADD("via6522_2", 0, vc1541_via2)
524   MDRV_VIA6522_ADD("via6522_3", 0, vc1541_via3)
525   
526523   MDRV_IMPORT_FROM(c64_cartslot)
527524MACHINE_DRIVER_END
528525
r4769r4770
535532   MDRV_QUANTUM_TIME(HZ(50))
536533
537534   MDRV_MACHINE_START( c64 )
535   MDRV_MACHINE_RESET( c64 )
538536
539537   /* video hardware */
540538   MDRV_IMPORT_FROM( vh_vic2_pal )
r4769r4770
594592
595593static MACHINE_DRIVER_START( sx64 )
596594   MDRV_IMPORT_FROM( c64pal )
595
597596   MDRV_IMPORT_FROM( cpu_vc1541 )
598597   MDRV_SOUND_REMOVE( "dac" )
599598   MDRV_CASSETTE_REMOVE( "cassette" )
r4769r4770
602601#else
603602   MDRV_QUANTUM_TIME(HZ(180000))
604603#endif
605   MDRV_VIA6522_ADD("via6522_2", 0, vc1541_via2)
606   MDRV_VIA6522_ADD("via6522_3", 0, vc1541_via3)
607604MACHINE_DRIVER_END
608605
609606
r4769r4770
616613
617614ROM_START( max )
618615   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
616   ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 )
619617ROM_END
620618
621619ROM_START( c64 )
r4769r4770
628626   ROM_SYSTEM_BIOS(2, "rev2", "Kernal rev. 2" )
629627   ROMX_LOAD( "901227-02.bin", 0x12000, 0x2000, CRC(a5c687b3) SHA1(0e2e4ee3f2d41f00bed72f9ab588b83e306fdb13), ROM_BIOS(3) )   // Kernal
630628   ROM_LOAD( "901225-01.bin", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) )   // Character
629
630   ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 )
631631ROM_END
632632
633633#define rom_c64pal   rom_c64
r4769r4770
637637   ROM_LOAD( "901226-01.bin", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) )
638638   ROM_LOAD( "906145-02.bin", 0x12000, 0x2000, CRC(3a9ef6f1) SHA1(4ff0f11e80f4b57430d8f0c3799ed0f0e0f4565d) )
639639   ROM_LOAD( "906143-02.bin", 0x14000, 0x1000, CRC(1604f6c1) SHA1(0fad19dbcdb12461c99657b2979dbb5c2e47b527) )
640
641   ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 )
640642ROM_END
641643
642644
r4769r4770
648650   ROMX_LOAD( "charswe.bin",0x14000, 0x1000, CRC(bee9b3fd) SHA1(446ae58f7110d74d434301491209299f66798d8a), ROM_BIOS(1) )
649651   ROM_SYSTEM_BIOS(1, "alt", "Swedish Characters (Alt)" )
650652   ROMX_LOAD( "charswe2.bin",0x14000, 0x1000, CRC(377a382b) SHA1(20df25e0ba1c88f31689c1521397c96968967fac), ROM_BIOS(2) )
653
654   ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 )
651655ROM_END
652656
653657#define rom_c64swe   rom_vic64s
r4769r4770
657661   ROM_LOAD( "901226-01.bin", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) )
658662   ROM_LOAD( "901246-01.bin", 0x12000, 0x2000, CRC(789c8cc5) SHA1(6c4fa9465f6091b174df27dfe679499df447503c) )
659663   ROM_LOAD( "901225-01.bin", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) )
664
665   ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 )
660666ROM_END
661667
662668#define rom_cbm4064 rom_pet64
r4769r4770
668674   ROM_LOAD( "251104-04.bin", 0x12000, 0x2000, CRC(2c5965d4) SHA1(aa136e91ecf3c5ac64f696b3dbcbfc5ba0871c98) )
669675   ROM_LOAD( "901225-01.bin", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) )
670676
677   ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 )
678
671679   VC1541_ROM( "cpu_vc1540" )
672680ROM_END
673681
r4769r4770
676684    ROM_LOAD( "901226-01.bin", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) )
677685    ROM_LOAD( "dx64kern.bin",     0x12000, 0x2000, CRC(58065128) )
678686
687   ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 )
688
679689    // vc1541 roms were not included in submission
680690    VC1541_ROM ("cpu_vc1540")
681691//   VC1541_ROM (" ")
r4769r4770
687697   ROM_LOAD( "kernelsx.swe",   0x12000, 0x2000, CRC(7858d3d7) SHA1(097cda60469492a8916c2677b7cce4e12a944bc0) )
688698   ROM_LOAD( "charswe.bin", 0x14000, 0x1000, CRC(bee9b3fd) SHA1(446ae58f7110d74d434301491209299f66798d8a) )
689699
700   ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 )
701
690702   VC1541_ROM( "cpu_vc1540" )
691703ROM_END
692704
r4769r4770
696708   /* standard basic, modified kernel */
697709   ROM_LOAD( "251913-01.bin", 0x10000, 0x4000, CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88) )
698710   ROM_LOAD( "901225-01.bin", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) )
711
712   ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 )
699713ROM_END
700714
701715#define rom_c64cpal      rom_c64c
r4769r4770
706720   /* standard basic, modified kernel */
707721   ROM_LOAD( "390852-01.bin", 0x10000, 0x4000, CRC(b0a9c2da) SHA1(21940ef5f1bfe67d7537164f7ca130a1095b067a) )
708722   ROM_LOAD( "901225-01.bin", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) )
723
724   ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 )
709725ROM_END
710726
711727

Previous 15994 Revisions Next


© 1998-2018 The MESS Team