Previous 15994 Revisions Next

r4791 Friday 22nd May, 2009 at 13:28:08 UTC by Fabio Priuli
[CBM] More clean-ups:
* added c128 swedish/finnish confirmed dump (thanks to Iggy Drougge)
* added c128d/81 (c128d proto with 1581 built-in drive)
* fixed TPI6525 regression in c16 emulated floppy
* added back floppy timer to c16 floppy reading code
* (slightly) improved head positioning and byte reading in floppy emulation
* enabled floppy emulation in sx64, c16v, vic20v (emulation does not work yet, but it does not crash anymore MESS either)
* added floppy drive firmware dumps for 1540, 1541, 1551, 1570, 1571, 1581, 2031 drives (see notes in vc1541.c)
* enabled floppy emulation in c16c, c128d, c128dcr, c128d81 (not working as sx64, but needed to document firmwares)
[docs]messnew.txt
[src/mess]messdriv.c
[src/mess/drivers]c128.c c16.c c64.c vc20.c
[src/mess/includes]c128.h vc1541.h
[src/mess/machine]c128.c c16.c vc1541.c vc20.c

src/mess/includes/vc1541.h
r4790r4791
1313
1414/* we currently have preliminary support for 1541 & 1551 only */
1515enum {
16type_1541 = 0,
17type_1541ii,
18type_1551,
19type_1570,
20type_1571,
21type_1571cr,
22type_1581,
23type_2031,
24type_2040,
25type_3040,
26type_4040,
27type_1001,
28type_8050,
29type_8250,
16   type_1541 = 0,
17   type_1541ii,
18   type_1551,
19   type_1570,
20   type_1571,
21   type_1571cr,
22   type_1581,
23   type_2031,
24   type_2040,
25   type_3040,
26   type_4040,
27   type_1001,
28   type_8050,
29   type_8250,
3030};
3131
3232enum {
33format_d64 = 0,         /* 1541 image, 35 tracks */
34format_d64_err,         /* 1541 image, 35 tracks + error table */
35format_d64_40t,         /* 1541 image, 40 tracks */
36format_d64_40t_err,      /* 1541 image, 40 tracks + error table */
37format_d67,            /* 2040 image, 35 tracks DOS1 format */
38format_d71,            /* 1571 image, 70 tracks */
39format_d71_err,         /* 1571 image, 70 tracks + error table */
40format_d81,            /* 1581 image, 80 tracks */
41format_d80,            /* 8050 image, 77 tracks */
42format_d82,            /* 8250 image, 154 tracks (read as 77?) */
43format_g64,            /* 1541 image in GCR format */
33   format_d64 = 0,         /* 1541 image, 35 tracks */
34   format_d64_err,         /* 1541 image, 35 tracks + error table */
35   format_d64_40t,         /* 1541 image, 40 tracks */
36   format_d64_40t_err,      /* 1541 image, 40 tracks + error table */
37   format_d67,            /* 2040 image, 35 tracks DOS1 format */
38   format_d71,            /* 1571 image, 70 tracks */
39   format_d71_err,         /* 1571 image, 70 tracks + error table */
40   format_d81,            /* 1581 image, 80 tracks */
41   format_d80,            /* 8050 image, 77 tracks */
42   format_d82,            /* 8250 image, 154 tracks (read as 77?) */
43   format_g64,            /* 1541 image in GCR format */
4444};
4545
4646
47int drive_config(running_machine *machine, int type, int id, int mode, const char *cputag, int devicenr);
47void drive_config(running_machine *machine, int type, int id, int mode, const char *cputag, int devicenr);
4848void c1551_config(running_machine *machine, const char *cputag);
4949void drive_reset(void);
50void c1551_drive_reset(void);
5051
5152void vc1541_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
5253void c1551_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
5354void c1571_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
55void c1581_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
5456/* the ones below are still not used in any drivers */
55void c1581_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
5657void c2031_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
5758void c2040_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
5859void c8050_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
r4790r4791
6162
6263MACHINE_DRIVER_EXTERN( cpu_vc1540 );
6364MACHINE_DRIVER_EXTERN( cpu_vc1541 );
65MACHINE_DRIVER_EXTERN( cpu_c1571 );
66MACHINE_DRIVER_EXTERN( cpu_c1571cr );
67MACHINE_DRIVER_EXTERN( cpu_c1581 );
6468MACHINE_DRIVER_EXTERN( cpu_c2031 );
65MACHINE_DRIVER_EXTERN( cpu_dolphin );
6669MACHINE_DRIVER_EXTERN( cpu_c1551 );
67MACHINE_DRIVER_EXTERN( cpu_c1571 );
6870
69#define VC1540_ROM(cpu) \
70   ROM_REGION(0x10000,cpu,0) \
71   ROM_LOAD("325302.01",  0xc000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11)) \
72   ROM_LOAD("325303.01",  0xe000, 0x2000, CRC(10b39158) SHA1(56dfe79b26f50af4e83fd9604857756d196516b9))
71// currently not used (hacked drive firmware with more RAM)
72MACHINE_DRIVER_EXTERN( cpu_dolphin );
7373
74#if 1
75#define C2031_ROM(cpu) \
76   ROM_REGION(0x10000,cpu,0) \
77   ROM_LOAD("dos2031",  0xc000, 0x4000, CRC(21b80fdf) SHA1(c53e180a96649ceb3f421739e8dc66faba7cba44))
78#else
79#define C2031_ROM(cpu) \
80   ROM_REGION(0x10000,cpu,0) \
81   ROM_LOAD("901484.03",  0xc000, 0x2000, CRC(ee4b893b) SHA1(54d608f7f07860f24186749f21c96724dd48bc50)) \
82   ROM_LOAD("901484.05",  0xe000, 0x2000, CRC(6a629054) SHA1(ec6b75ecfdd4744e5d57979ef6af990444c11ae1))
83#endif
8474
85#if 1
86#define VC1541_ROM(cpu) \
87   ROM_REGION(0x10000,cpu,0) \
88   ROM_LOAD("325302.01",  0xc000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11)) \
89   ROM_LOAD("901229.05",  0xe000, 0x2000, CRC(361c9f37) SHA1(f5d60777440829e46dc91285e662ba072acd2d8b) )
90#else
91/* for this I have the documented rom listing in german */
92#define VC1541_ROM(cpu) \
93   ROM_REGION(0x10000,cpu,0) \
94   ROM_LOAD("325302.01",  0xc000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11)) \
95   ROM_LOAD("901229.03",  0xe000, 0x2000, CRC(9126e74a) SHA1(03d17bd745066f1ead801c5183ac1d3af7809744))
96#endif
75/* IEC interface for c16 with c1551 */
9776
98#define DOLPHIN_ROM(cpu) \
99   ROM_REGION(0x10000,cpu,0) \
100   ROM_LOAD("c1541.rom",  0xa000, 0x6000, CRC(bd8e42b2) SHA1(d6aff55fc70876fa72be45c666b6f42b92689b4d))
77/* To be passed directly to the drivers */
78WRITE8_DEVICE_HANDLER( c1551x_write_data );
79READ8_DEVICE_HANDLER( c1551x_read_data );
80WRITE8_DEVICE_HANDLER( c1551x_write_handshake );
81READ8_DEVICE_HANDLER( c1551x_read_handshake );
82READ8_DEVICE_HANDLER( c1551x_read_status );
10183
102#define C1551_ROM(cpu) \
103   ROM_REGION(0x10000,cpu,0) \
104   ROM_LOAD("318008.01",  0xc000, 0x4000, CRC(6d16d024) SHA1(fae3c788ad9a6cc2dbdfbcf6c0264b2ca921d55e))
10584
106#define C1570_ROM(cpu) \
107   ROM_REGION(0x10000,cpu,0) \
108   ROM_LOAD("315090.01",  0x8000, 0x8000, CRC(5a0c7937) SHA1(5fc06dc82ff6840f183bd43a4d9b8a16956b2f56))
85/* serial bus for vic20, c64 & c16 with vc1541 and some printer */
10986
110#define C1571_ROM(cpu) \
111   ROM_REGION(0x10000,cpu,0) \
112   ROM_LOAD("310654.03",  0x8000, 0x8000, CRC(3889b8b8) SHA1(e649ef4419d65829d2afd65e07d31f3ce147d6eb))
87/* To be passed to serial bus emulation */
88void vc1541_serial_reset_write(running_machine *machine, int which, int level);
89int vc1541_serial_atn_read(running_machine *machine, int which);
90void vc1541_serial_atn_write(running_machine *machine, int which, int level);
91int vc1541_serial_data_read(running_machine *machine, int which);
92void vc1541_serial_data_write(running_machine *machine, int which, int level);
93int vc1541_serial_clock_read(running_machine *machine, int which);
94void vc1541_serial_clock_write(running_machine *machine, int which, int level);
95int vc1541_serial_request_read(running_machine *machine, int which);
96void vc1541_serial_request_write(running_machine *machine, int which, int level);
11397
114#if 0
115   ROM_LOAD("dos2040",  0x?000, 0x2000, CRC(d04c1fbb))
11698
117   ROM_LOAD("dos3040",  0x?000, 0x3000, CRC(f4967a7f))
11899
119   ROM_LOAD("dos4040", 0x?000, 0x3000, CRC(40e0ebaa))
100/* Floppy drive ROMs */
120101
121   ROM_LOAD("dos1001",  0xc000, 0x4000, CRC(87e6a94e))
102/****************************************************************************
122103
123   /* vc1541 drive hardware */
124   ROM_LOAD("dos2031",  0xc000, 0x4000, CRC(21b80fdf))
104Info from zimmers.net
125105
126   ROM_LOAD("1540-c000.325302-01.bin",  0xc000, 0x2000, CRC(29ae9752))
127   ROM_LOAD("1540-e000.325303-01.bin",  0xe000, 0x2000, CRC(10b39158))
1061551 Parts
128107
129   ROM_LOAD("1541-e000.901229-01.bin",  0xe000, 0x2000, CRC(9a48d3f0))
130   ROM_LOAD("1541-e000.901229-02.bin",  0xe000, 0x2000, CRC(b29bab75))
131   ROM_LOAD("1541-e000.901229-03.bin",  0xe000, 0x2000, CRC(9126e74a))
132   ROM_LOAD("1541-e000.901229-05.bin",  0xe000, 0x2000, CRC(361c9f37))
108Location       Part Number     Description
109U4             318008-01       23128 ROM DOS 2.6 C000-FFFF
110U5                             6116 2K x 8 Static RAM
111U6                             HD61J215P 42 pin Gate Array
112U7             251829-01       64H157 20 pin Gate Array
113U2                             6510T CPU
114U3                             6525A TPI
115U11            251853-01       R/W Hybrid
133116
134   ROM_LOAD("1541-II.251968-03.bin",  0xe000, 0x2000, CRC(899fa3c5))
117Interface Cartridge:
118U2                             6523 Tri-Port Interface
119U1             251641-03       82S100 PLA
135120
136   ROM_LOAD("1541C.251968-01.bin",  0xc000, 0x4000, CRC(1b3ca08d))
137   ROM_LOAD("1541C.251968-02.bin",  0xc000, 0x4000, CRC(2d862d20))
121****************************************************************************/
138122
139   ROM_LOAD("dos1541.c0",  0xc000, 0x2000, CRC(5b84bcef))
140   ROM_LOAD("dos1541.e0",  0xe000, 0x2000, CRC(2d8c1fde))
141    /* merged gives 0x899fa3c5 */
123#define C1551_ROM( cpu )   \
124   ROM_REGION( 0x10000, cpu, 0 )   \
125   ROM_LOAD( "318008-01.u4", 0xc000, 0x4000, CRC(6d16d024) SHA1(fae3c788ad9a6cc2dbdfbcf6c0264b2ca921d55e) )
142126
143    /* 0x29ae9752 and 0x361c9f37 merged */
144   ROM_LOAD("vc1541",  0xc000, 0x4000, CRC(57224cde))
145127
146    /* 0x29ae9752 and 0xb29bab75 merged */
147   ROM_LOAD("vc1541",  0xc000, 0x4000, CRC(d3a5789c))
148128
149   /* dolphin vc1541 */
150   ROM_LOAD("c1541.rom",  0xa000, 0x6000, CRC(bd8e42b2))
129/****************************************************************************
151130
152   ROM_LOAD("1551.318008-01.bin", 0xc000, 0x4000, CRC(6d16d024))
131Info from zimmers.net
153132
154   /* bug fixes introduced bugs for 1541 mode
155     jiffydos to have fixed 1571 and working 1541 mode */
156   ROM_LOAD("1570-rom.315090-01.bin",  0x8000, 0x8000, CRC(5a0c7937))
157   ROM_LOAD("1571-rom.310654-03.bin",  0x8000, 0x8000, CRC(3889b8b8))
158   ROM_LOAD("1571-rom.310654-05.bin",  0x8000, 0x8000, CRC(5755bae3))
159   ROM_LOAD("1571cr-rom.318047-01.bin",  0x8000, 0x8000, CRC(f24efcc4))
1331540/1541/1541A/SX-64 Parts
160134
161   ROM_LOAD("1581-rom.318045-01.bin",  0x8000, 0x8000, CRC(113af078))
162   ROM_LOAD("1581-rom.318045-02.bin",  0x8000, 0x8000, CRC(a9011b84))
163   ROM_LOAD("1581-rom.beta.bin",  0x8000, 0x8000, CRC(ecc223cd))
135Location       Part Number    Description
136                              2016 2K x 8 bit Static RAM (short board)
137UA2-UB3                       2114 (4) 1K x 4 bit Static RAM (long board)
138               325302-01      2364-130 ROM DOS 2.6 C000-DFFF
139               325303-01      2364-131 ROM DOS 2.6 (1540) E000-FFFF
140               901229-01      2364-173 ROM DOS 2.6 (1541) E000-FFFF
141               901229-03      2364-197 ROM DOS 2.6 rev. 1 E000-FFFF
142               901229-05      2364     ROM DOS 2.6 rev. 2 E000-FFFF
143               325572-01      64H105 40 pin Gate Array (short board)
144                              6502 CPU
145                              6522 (2) VIA
146drive                         Alps DFB111M25A
147drive                         Alps FDM2111-B2
148drive                         Newtronics D500
164149
165   /* modified drive 0x2000-0x3ffe ram, 0x3fff 6529 */
166   ROM_LOAD("1581rom5.bin",  0x8000, 0x8000, CRC(e08801d7))
1501541B/1541C Parts
167151
168   ROM_LOAD("",  0xc000, 0x4000, CRC())
169#endif
152Location       Part Number    Description
153UA3                           2016 2K x 8 bit Static RAM
154UA2            251968-01      23128 ROM DOS 2.6 rev. 3 C000-FFFF
155UA2            251968-01      27128 EPROM DOS 2.6 rev. 3 C000-FFFF
156UC4            251828-02      64H156 42 pin Gate Array
157UC5            251829-01      64H157 20 pin Gate Array
158UC2                           6502 CPU
159UC1, UC3                      6522 (2) CIA
160UD1          * 251853-01      R/W Hybrid
161UD1          * 251853-02      R/W Hybrid
162drive                         Newtronics D500
163  * Not interchangeable.
170164
1651541-II Parts
171166
172/* IEC interface for c16 with c1551 */
167Location       Part Number    Description
168U5                            2016-15 2K x 8 bit Static RAM
169U12                           SONY CX20185 R/W Amp.
170U4             251968-03      16K ROM DOS 2.6 rev. 4 C000-FFFF
171U10            251828-01      64H156 40 pin Gate Array
172U3                            6502A CPU
173U6, U8                        6522 (2) CIA
174drive                         Chinon FZ-501M REV A
175drive                         Digital System DS-50F
176drive                         Newtronics D500
177drive                         Safronic DS-50F
173178
174/* To be passed directly to the drivers */
175WRITE8_DEVICE_HANDLER( c1551x_write_data );
176READ8_DEVICE_HANDLER( c1551x_read_data );
177WRITE8_DEVICE_HANDLER( c1551x_write_handshake );
178READ8_DEVICE_HANDLER( c1551x_read_handshake );
179READ8_DEVICE_HANDLER( c1551x_read_status );
180179
181180
182/* serial bus for vic20, c64 & c16 with vc1541 and some printer */
181Note: according to additional docs at zimmers.net, ROMs in these drive
182were interchangeable: you could burn later revisions on EEPROM and put
183them in older drives and they would work perfectly.
183184
184/* To be passed to serial bus emulation */
185void vc1541_serial_reset_write(running_machine *machine, int which, int level);
186int vc1541_serial_atn_read(running_machine *machine, int which);
187void vc1541_serial_atn_write(running_machine *machine, int which, int level);
188int vc1541_serial_data_read(running_machine *machine, int which);
189void vc1541_serial_data_write(running_machine *machine, int which, int level);
190int vc1541_serial_clock_read(running_machine *machine, int which);
191void vc1541_serial_clock_write(running_machine *machine, int which, int level);
192int vc1541_serial_request_read(running_machine *machine, int which);
193void vc1541_serial_request_write(running_machine *machine, int which, int level);
185****************************************************************************/
194186
187// I'm not 100% sure about UA2/UB3 locations used below for ROM names
188// I need a picture to confirm these, since the part listing above is not really clear (without a pic of the board)
189#define VC1540_ROM( cpu )   \
190   ROM_REGION( 0x10000, cpu, 0 )   \
191   ROM_LOAD( "325302-01.ua2", 0xc000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11) )   \
192   ROM_LOAD( "325303-01.ub3", 0xe000, 0x2000, CRC(10b39158) SHA1(56dfe79b26f50af4e83fd9604857756d196516b9) )
195193
194/*
195    rev. 01 - It is believed to be the first revision of the 1541 firmware. The service manual says that this ROM
196        is for North America and Japan only.
197    rev. 02 - Second version of the 1541 firmware. The service manual says that this ROM was not available in North
198        America (Japan only?).
199    rev. 03 - It is said to be the first version that is usable in Europe (in the service manual?).
200    rev. 05 - From an old-style 1541 with short board.
201    rev. 06AA - From an old-style 1541 with short board.
202*/
203#define VC1541_ROM( cpu )   \
204   ROM_REGION( 0x10000, cpu, 0 )   \
205   ROM_SYSTEM_BIOS( 0, "rev1", "VC-1541 rev. 01" )   \
206   ROMX_LOAD( "325302-01.ua2", 0xc000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11), ROM_BIOS(1) )   \
207   ROMX_LOAD( "901229-01.ub3", 0xe000, 0x2000, CRC(9a48d3f0) SHA1(7a1054c6156b51c25410caec0f609efb079d3a77), ROM_BIOS(1) )   \
208   ROM_SYSTEM_BIOS( 1, "rev2", "VC-1541 rev. 02" )   \
209   ROMX_LOAD( "325302-01.ua2", 0xc000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11), ROM_BIOS(2) )   \
210   ROMX_LOAD( "901229-02.ub3", 0xe000, 0x2000, CRC(b29bab75) SHA1(91321142e226168b1139c30c83896933f317d000), ROM_BIOS(2) )   \
211   ROM_SYSTEM_BIOS( 2, "rev3", "VC-1541 rev. 03" )   \
212   ROMX_LOAD( "325302-01.ua2", 0xc000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11), ROM_BIOS(3) )   \
213   ROMX_LOAD( "901229-03.ub3", 0xe000, 0x2000, CRC(9126e74a) SHA1(03d17bd745066f1ead801c5183ac1d3af7809744), ROM_BIOS(3) )   \
214   ROM_SYSTEM_BIOS( 3, "rev5", "VC-1541 rev. 05" )   \
215   ROMX_LOAD( "325302-01.ua2", 0xc000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11), ROM_BIOS(4) )   \
216   ROMX_LOAD( "901229-05.ub3", 0xe000, 0x2000, CRC(361c9f37) SHA1(f5d60777440829e46dc91285e662ba072acd2d8b), ROM_BIOS(4) )   \
217   ROM_SYSTEM_BIOS( 4, "rev6aa", "VC-1541 rev. 06AA" )   \
218   ROMX_LOAD( "325302-01.ua2", 0xc000, 0x2000, CRC(29ae9752) SHA1(8e0547430135ba462525c224e76356bd3d430f11), ROM_BIOS(5) )   \
219   ROMX_LOAD( "901229-06aa.ub3", 0xe000, 0x2000, CRC(3a235039) SHA1(c7f94f4f51d6de4cdc21ecbb7e57bb209f0530c0), ROM_BIOS(5) )   \
220   ROM_SYSTEM_BIOS( 5, "rev1c", "VC-1541C rev. 01" )   \
221   ROMX_LOAD( "251968-01.ua2", 0xc000, 0x4000, CRC(1b3ca08d) SHA1(8e893932de8cce244117fcea4c46b7c39c6a7765), ROM_BIOS(6) )   \
222   ROM_SYSTEM_BIOS( 6, "rev2c", "VC-1541C rev. 02" )   \
223   ROMX_LOAD( "251968-02.ua2", 0xc000, 0x4000, CRC(2d862d20) SHA1(38a7a489c7bbc8661cf63476bf1eb07b38b1c704), ROM_BIOS(7) )   \
224   ROM_SYSTEM_BIOS( 7, "rev3ii", "VC-1541-II" )   \
225   ROMX_LOAD( "251968-03.u4", 0xc000, 0x4000, CRC(899fa3c5) SHA1(d3b78c3dbac55f5199f33f3fe0036439811f7fb3), ROM_BIOS(8) )   \
226   ROM_SYSTEM_BIOS( 8, "reviin", "VC-1541-II (with Newtronics D500)" )   \
227   ROMX_LOAD( "355640-01.u4", 0xc000, 0x4000, CRC(57224cde) SHA1(ab16f56989b27d89babe5f89c5a8cb3da71a82f0), ROM_BIOS(9) )   \
228
229
230
231// currently not used (hacked drive firmware with more RAM)
232#define DOLPHIN_ROM( cpu )   \
233   ROM_REGION( 0x10000, cpu, 0 )   \
234   ROM_LOAD( "c1541.rom", 0xa000, 0x6000, CRC(bd8e42b2) SHA1(d6aff55fc70876fa72be45c666b6f42b92689b4d) )
235
236
237
238/****************************************************************************
239
240Info from zimmers.net
241
2421570 Parts
243
244Location       Part Number    Description
245               315090-01      32K ROM DOS 3.0
246drive                         Alps
247
2481571 Parts
249
250Location       Part Number    Description
251U11                           WD1770 FDC
252U11                           WD1772 FDC
253U3                            2016-20 2K x 8 bit Static RAM
254U1                            6502A CPU
255U4, U9                        65C22A (2) CIA
256U20                           6526A CIA
257U20                           8520 CIA
258U6             251828-01      64H156 40 pin Gate Array
259U5             251829-01      64H157 20 pin Gate Array
260U7             251853-01      R/W Hybrid
261U2             310654-03      23256 ROM DOS 3.0
262U2             310654-05      32K ROM DOS 3.0 rev.
263drive                         Alps
264drive                         Newtronics D502
265
266C128D Parts
267
268Location       Part Number    Description
269U103                          2016-20 2K x 8 bit Static RAM
270U108           252308-01      MC2871A R/W Amp.
271U107           252371-01      MOS5710 FDC and Gate Array
272U101                          6502A CPU
273U104, U106                    65C22 (2) CIA
274U105           251828-01      64H156 40 pin Gate Array
275U102           318047-01      23256 ROM DOS 3.1
276drive                         Newtronics D502
277
278
279****************************************************************************/
280
281// no locations available for this, I need a picture of the board
282// currently, we add 1570 to 1571, to preserve the firmware.
283// this will be used later, when proper drives will be added to each system
284#define C1570_ROM( cpu ) \
285   ROM_REGION( 0x10000, cpu, 0) \
286   ROM_LOAD( "315090-01.bin", 0x8000, 0x8000, CRC(5a0c7937) SHA1(5fc06dc82ff6840f183bd43a4d9b8a16956b2f56) )
287
288
289#define C1571_ROM( cpu ) \
290   ROM_REGION( 0x10000, cpu, 0 ) \
291   ROM_SYSTEM_BIOS( 0, "rev5", "1571 rev. 05" )   \
292   ROMX_LOAD( "310654-05.u2", 0x8000, 0x8000, CRC(5755bae3) SHA1(f1be619c106641a685f6609e4d43d6fc9eac1e70), ROM_BIOS(1) )   \
293   ROM_SYSTEM_BIOS( 1, "rev3", "1571 rev. 03" )   \
294   ROMX_LOAD( "310654-03.u2", 0x8000, 0x8000, CRC(3889b8b8) SHA1(e649ef4419d65829d2afd65e07d31f3ce147d6eb), ROM_BIOS(2) )   \
295   /* This should not be here... */   \
296   ROM_SYSTEM_BIOS( 2, "1570", "1570" )   \
297   ROMX_LOAD( "315090-01.bin", 0x8000, 0x8000, CRC(5a0c7937) SHA1(5fc06dc82ff6840f183bd43a4d9b8a16956b2f56), ROM_BIOS(3) )
298
299
300#define C1571CR_ROM( cpu ) \
301   ROM_REGION( 0x10000, cpu, 0) \
302   ROM_LOAD( "318047-01.u102", 0x8000, 0x8000, CRC(f24efcc4) SHA1(14ee7a0fb7e1c59c51fbf781f944387037daa3ee) )
303
304
305// no locations available for this, I need a picture of the board
306/*
307    rev. 01 - First revision of 1581 firmware
308    rev. 02 - Second revision of 1581 firmware
309    beta - Probably a beta version
310    1563 - This comes from a prototype unit of the so-called c128d/81 (a c128d with built-in 1581 drive).
311        Despite the label, is a 1581 firmaware
312*/
313#define C1581_ROM( cpu ) \
314   ROM_REGION( 0x10000, cpu, 0 ) \
315   ROM_SYSTEM_BIOS( 0, "rev2", "1581 rev. 02" )   \
316   ROMX_LOAD( "318045-02.bin", 0x8000, 0x8000, CRC(a9011b84) SHA1(01228eae6f066bd9b7b2b6a7fa3f667e41dad393), ROM_BIOS(1) )   \
317   ROM_SYSTEM_BIOS( 1, "rev1", "1581 rev. 01" )   \
318   ROMX_LOAD( "318045-01.bin", 0x8000, 0x8000, CRC(113af078) SHA1(3fc088349ab83e8f5948b7670c866a3c954e6164), ROM_BIOS(2) )   \
319   ROM_SYSTEM_BIOS( 2, "beta", "1581 beta?" )   \
320   ROMX_LOAD( "1581-beta.bin", 0x8000, 0x8000, CRC(ecc223cd) SHA1(a331d0d46ead1f0275b4ca594f87c6694d9d9594), ROM_BIOS(3) )   \
321   ROM_SYSTEM_BIOS( 3, "1563", "1563 (from C128D/81)" )   \
322   ROMX_LOAD( "1563.bin", 0x8000, 0x8000, CRC(1d184687) SHA1(2c5111a9c15be7b7955f6c8775fea25ec10c0ca0), ROM_BIOS(4) )
323
324
325
326/* Older drive - currently these are only added as documentation (no driver uses them yet) */
327/* They all use IEEE-448 connector */
328
329/****************************************************************************
330
331Info from zimmers.net
332
3332031 Parts
334
335Location       Part Number    Description
336UB2                           2016 2K x 8 bit static RAM (HP)
337U3B-U3E                       2114 (4) 1K x 4 bit static RAM (LP)
338               901484-03      2364-107 ROM DOS 2.6 C000-DFFF
339               901484-05      2364-123 ROM DOS 2.6 E000-FFFF
340                              6502 CPU
341                              6522 (2) VIA
342drive                         Alps DFB111M25A (LP)
343drive                         Alps FDM2111-B2 (LP)
344drive                         Shugart 390 (HP)
345
346****************************************************************************/
347
348// I'm not 100% sure about U3B/U3E locations used below for ROM names
349// I need a picture to confirm these, since the part listing above is not really clear (without a pic of the board)
350#define C2031_ROM( cpu )   \
351   ROM_REGION( 0x10000, cpu, 0 )   \
352   ROM_LOAD( "901484-03.u3b", 0xc000, 0x2000, CRC(ee4b893b) SHA1(54d608f7f07860f24186749f21c96724dd48bc50) )      \
353   ROM_LOAD( "901484-05.u3e", 0xe000, 0x2000, CRC(6a629054) SHA1(ec6b75ecfdd4744e5d57979ef6af990444c11ae1) )
354
355
356
357/****************************************************************************
358
359Info from zimmers.net
360
361SFD-1001 Parts
362
363Location       Part Number    Description
3647G, 9G                        2116 (2) 2K x 8 static RAM
365
366DOS:
3671J             901887-01      2364 ROM DOS 2.7 C000-DFFF
3683J             901887-02      2364 ROM DOS 2.7 E000-FFFF
3693J             901888-01      2364 ROM DOS 2.7 E000-FFFF
3702H                            6502 CPU
3714J, 6J                        6532 (2) RIOT
372
373Controller:
3745C             901467-01      6316-017 ROM GCR
3751E                            6502 CPU
3765E                            6522 VIA
3773E             251232         adapter board
378drive                         Matsushita JU-570-2
379
380Adapter Board:
381U2             251257-02A     2716 EPROM controller
382U1                            6530 RIOT (ROM disabled)
383
384
385Notes: The DOS 2.7 ROM in SFD-1001 is the same as in 8250 drives. Differences:
386
387CBM 8050 - dual 5" 1/4 floppy drive, disks are written on one side
388      with double density
389CBM   8250 / 8250LP - dual 5.25" 1/4 floppy drive, disks are written
390      on both sides. it reads 8050-disks, LP version has smaller case
391SFD-1001 - single 5" 1/4 floppy drive, same as CBM 8250LP, but only
392      one drive and 1541-case
393
394****************************************************************************/
395
396#define SFD1001_ROM( cpu )   \
397   ROM_REGION( 0x10800, cpu, 0 )   \
398   ROM_LOAD( "901887-01.1j", 0xc000, 0x2000, CRC(0073b8b2) )      \
399   ROM_LOAD( "901888-01.3j", 0xe000, 0x2000, CRC(de9b6132) )      \
400   ROM_LOAD( "251257-02a.u2", 0x10000, 0x800, CRC(b51150de) )   /* Floppy Disc Controller */
401
402
403#define C8250_ROM( cpu )   \
404   ROM_REGION( 0x10000, cpu, 0 )
405
406// still to be sorted out
407
408/****************************************************************************
409
410Info from zimmers.net
411
4122040/3040/4040 Parts
413
414Location       Part Number    Description
415UC4-UF5                       2114 (8) 1K x 4 bit static RAM
416
417DOS:
418UL1            901468-06      2332-020 ROM DOS 1 E000-EFFF
419UH1            901468-07      2332-021 ROM DOS 1 F000-FFFF
420UJ1            901468-11      2332 ROM DOS 2 D000-DFFF
421UL1            901468-12      2332 ROM DOS 2 E000-EFFF
422UH1            901468-13      2332 ROM DOS 2 F000-FFFF
423UJ1            901468-14      2332-191 ROM DOS 2 rev. D000-DFFF
424UL1            901468-15      2332-192 ROM DOS 2 rev. E000-EFFF
425UH1            901468-16      2332-193 ROM DOS 2 rev. F000-FFFF
426UN1                           6502 CPU
427UC1, UE1                      6532 (2) RIOT
428
429Controller:
430UH3                           6504 CPU
431UM3                           6522 VIA
432UK3            901466-02      6530-028 RIOT DOS 1
433UK3            901466-04      6530-034 RIOT DOS 2
434UK6            901467-01      6316-017 ROM GCR
435drive                         Shugart 390
436
437****************************************************************************/
438
439#define C4040_ROM( cpu )   \
440   ROM_REGION( 0x10000, cpu, 0 )   
441
442// still to be sorted out
443
444
445/****************************************************************************
446
447Info from zimmers.net
448
4499060/9090 Parts
450
451Location  Part Number   Description
4525A-5H                   2114 (8) 1K x 4 bit Static RAM
453
454DOS:
4557C        300516-002  * 2564 EPROM DOS 3.0 C000-DFFF (rev. B)
4567D        300517-002  * 2564 EPROM DOS 3.0 E000-FFFF (rev. B)
4577C        300516-001  + 2764 EPROM DOS 3.0 C000-DFFF (rev. B)
4587D        300517-001  + 2764 EPROM DOS 3.0 E000-FFFF (rev. B)
4597C        300516      * 2564 EPROM DOS 3.0 rev. C000-DFFF (rev. C)
4607D        300517      * 2564 EPROM DOS 3.0 rev. E000-FFFF (rev. C)
4617C        300516      + 2764 EPROM DOS 3.0 rev. C000-DFFF (rev. C)
4627D        300517      + 2764 EPROM DOS 3.0 rev. E000-FFFF (rev. C)
4637E                      6502 CPU
4647F, 7G                  6532 (2) RIOT
465 * 2564 are used on PCB 300012-001
466 + 2764 are used on PCB 230012-002
467
468Controller:
4694C        300515        2716 EPROM DOS 3.0 (rev. A)
4704C        300515-001    2716 EPROM DOS 3.0 (rev. B)
4714A                      6502 CPU
4724B                      6522 VIA
4734D                      6810 128 x 8 bit Static RAM
474
475Winchester Controller:
4769D                      Am2910 12 bit Bit/Slice Controller
477drive                   Tandon TM602S (9060)
478drive                   Tandon TM603S (9090)
479
480
481Note: The Commodore D9060 and D9090 can use the same firmware. The
482difference between these units is that the jumper J14 on the DOS board
483is open in the D9060, and closed in the D9090 to select a 4-head vs.
4846-head drive. The jumper J13 seems to be unused.
485
486****************************************************************************/
487
488#define D9090_ROM( cpu )   \
489   ROM_REGION( 0x10800, cpu, 0 )   \
490   ROM_SYSTEM_BIOS( 0, "reva", "D9090 rev. A" )   \
491   ROMX_LOAD( "300516-revb.7c", 0xc000, 0x2000, CRC(2d758a14), ROM_BIOS(1) )   /* No Rev A available for this! */   \
492   ROMX_LOAD( "300517-reva.7d", 0xe000, 0x2000, CRC(566df630), ROM_BIOS(1) )   \
493   ROMX_LOAD( "300515-reva.4c", 0x10000, 0x800, CRC(99e096f7), ROM_BIOS(1) )   /* Floppy Disc Controller Rev. A - label "300515 Rev A" */   \
494   ROM_SYSTEM_BIOS( 1, "revb", "D9090 rev. B" )   \
495   ROMX_LOAD( "300516-revb.7c", 0xc000, 0x2000, CRC(2d758a14), ROM_BIOS(2) )   \
496   ROMX_LOAD( "300517-revb.7d", 0xe000, 0x2000, CRC(f0382bc3), ROM_BIOS(2) )   \
497   ROMX_LOAD( "300515-revb.4c", 0x10000, 0x800, CRC(49adf4fb), ROM_BIOS(2) )   /* Floppy Disc Controller Rev. B - label "300515 Rev B" or "300515-001" */   \
498   ROM_SYSTEM_BIOS( 2, "revc", "D9090 rev. C" )   \
499   ROMX_LOAD( "300516-revc.7c", 0xc000, 0x2000, CRC(d6a3e88f), ROM_BIOS(3) )   \
500   ROMX_LOAD( "300517-revc.7d", 0xe000, 0x2000, CRC(2a9ad4ad), ROM_BIOS(3) )   \
501   ROMX_LOAD( "300515-revb.4c", 0x10000, 0x800, CRC(49adf4fb), ROM_BIOS(3) )   /* Floppy Disc Controller Rev. B - label "300515 Rev B" or "300515-001" */
502
503
504/****************************************************************************
505
506   Dual 8" floppy drive. Related to any other drive? What about 8060?
507
508****************************************************************************/
509
510#define C8280_ROM( cpu )   \
511   ROM_REGION( 0x10800, cpu, 0 )   \
512   ROM_LOAD( "300542-001.bin", 0xc000, 0x2000, CRC(3c6eee1e) )      \
513   ROM_LOAD( "300543-001.bin", 0xe000, 0x2000, CRC(f58e665e) )      \
514   ROM_LOAD( "300541-001.bin", 0x10000, 0x800, CRC(cb07b2db) )   /* GCR encoding/decoding tables? */
515
516
517
518#if 0
519   ROM_LOAD("dos2040",  0x?000, 0x2000, CRC(d04c1fbb))
520
521   ROM_LOAD("dos3040",  0x?000, 0x3000, CRC(f4967a7f))
522
523   ROM_LOAD("dos4040",  0x?000, 0x3000, CRC(40e0ebaa))
524
525   ROM_LOAD("dos1001",  0xc000, 0x4000, CRC(87e6a94e))
526
527   /* dolphin vc1541 */
528   ROM_LOAD("c1541.rom",  0xa000, 0x6000, CRC(bd8e42b2))
529
530   /* modified drive 0x2000-0x3ffe ram, 0x3fff 6529 */
531   ROM_LOAD("1581rom5.bin",  0x8000, 0x8000, CRC(e08801d7))
532
533   ROM_LOAD("",  0xc000, 0x4000, CRC())
534#endif
535
196536#endif /* VC1541_H_ */
src/mess/includes/c128.h
r4790r4791
5151extern DRIVER_INIT( c128pal );
5252extern DRIVER_INIT( c128d );
5353extern DRIVER_INIT( c128dpal );
54extern DRIVER_INIT( c128dcr );
55extern DRIVER_INIT( c128dcrp );
56extern DRIVER_INIT( c128d81 );
5457extern MACHINE_START( c128 );
5558extern MACHINE_RESET( c128 );
5659extern INTERRUPT_GEN( c128_frame_interrupt );
src/mess/messdriv.c
r4790r4791
372372   DRIVER( vic20v )   /* Commodore VIC 20 (NTSC, VC1540)               */
373373   DRIVER( vic20pal )   /* Commodore VIC 20 (PAL)                     */
374374   DRIVER( vic20crp )   /* Commodore VIC 20CR (PAL)                     */
375   DRIVER( vic20plv )   /* Commodore VIC 20 (PAL, VC1541)               */
375   DRIVER( vic20plv )   /* Commodore VIC 20 (PAL, VC1540)               */
376376   DRIVER( vc20 )      /* Commodore VIC 20 (PAL, Germany)               */
377   DRIVER( vc20v )      /* Commodore VIC 20 (PAL, VC1541)               */
377   DRIVER( vc20v )      /* Commodore VIC 20 (PAL, VC1540)               */
378378   DRIVER( vic20swe )   /* Commodore VIC 20 (Swedish Expanson Kit)         */
379379
380380   DRIVER( max )      /* Commodore Max Machine (Japan)               */
r4790r4791
424424
425425   DRIVER( c128 )      /* Commodore 128 - NTSC                        */
426426   DRIVER( c128cr )   /* Commodore 128CR - NTSC (proto?)               */
427   DRIVER( c128fin )   /* Commodore 128 - PAL (Finnish)               */
427   DRIVER( c128sfi )   /* Commodore 128 - PAL (Swedish / Finnish)         */
428   DRIVER( c128fino )   /* Commodore 128 - PAL (Finnish, Unconfirmed dumps)   */
428429   DRIVER( c128fra )   /* Commodore 128 - PAL (French)                  */
429430   DRIVER( c128ger )   /* Commodore 128 - PAL (German)                  */
430431   DRIVER( c128nor )   /* Commodore 128 - PAL (Norwegian)               */
r4790r4791
434435   DRIVER( c128drde )   /* Commodore 128DCR - PAL (German)               */
435436   DRIVER( c128drit )   /* Commodore 128DCR - PAL (Italian)               */
436437   DRIVER( c128drsw )   /* Commodore 128DCR - PAL (Swedish)               */
438   DRIVER( c128d81 )   /* Commodore 128D/81                        */
437439
438440   DRIVER( a500n )      /* Commodore Amiga 500 - NTSC                  */
439441   DRIVER( a500p )      /* Commodore Amiga 500 - PAL                  */
src/mess/machine/vc1541.c
r4790r4791
111111disk image handling...
112112
113113Current status:
114   + preliminary vc1541 & c1551 implementation (seems very slow)
114   + preliminary vc1541 & c1551 implementation (quite slow, especially
115      if you turn on logging)
115116   + no support for other drive types (even if now I list all
116117      the variants supported by Vice in the enum)
117118   + communications between the drive CPU and the computer CPU have
118      to be checked, debugged and improved
119      to be checked, debugged and improved: somehow it works, but no
120      sync bit is set (encoding bug? timers-related bug?) and the drive
121      keeps reading beyond the end of the track (synchronization
122      problems?)
119123   + all but .g64 images should be correctly encoded at loading time
120124      (I actually have doubts about some .d82 details)
121125   + error maps are not still used, even if their presence is
122126      acknowledged
123   + the floppy handling still uses CBM_Drive_Emu struct instead of
124      functions similar to other floppy formats
127   + floppy drives should become devices and use ROMREGION_LOADBYNAME
128      for their ROMs (not the current defines)
129   + all available drive dumps are included for each systems using it
130      (vc1541 = sx64, vip64, c16v, plus4v; vc1571 = c128d; vc1571cr = c128dcr;
131      vc1581 = c128d81; vc1540 = vc20v, vic20plv; c2031 = vc20i (only dumps added);
132      c1551 = c16c, plus4c). this is only a temporary workaround to document
133      available dumps. correct revisions will be used with each systems when
134      emulation works (or 'default' bios will be used for most common
135      configurations, when machines were compatible with more than a single
136      drive model)
125137*/
126138/*
127139Informations on the fileformats (which the code is based on)
r4790r4791
200212   const char *cputag;
201213   int type;
202214
203   struct {
204      int deviceid;
205      int serial_atn, serial_clock, serial_data;
206      int acka, data;
207   } vc1541_serial;
208
209   int via0irq, via1irq;
210
211215   int led, motor, frequency;
212216
213217   double track;
214218   int clock;
215   int pos;      // from the beginning of the current track!
219   int start_pos, pos;      // start_pos = start of half track ; pos = position from the beginning of the current half-track!
216220
217221   void *timer;
218222
219223   GCR_data gcr;
220224
225   /* vc1541 specific */
226   struct {
227      int deviceid;
228      int serial_atn, serial_clock, serial_data;
229      int acka, data;
230   } vc1541_serial;
231
232   int via0irq, via1irq;
233
221234} vc1541_drive_emu;
222235
223236typedef struct
224237{
225238   const char *cputag;
239   int type;
226240
227   UINT8 cpu_ddr, cpu_port;
228   void *irq_timer;
241   int led, motor, frequency;
229242
230   int led, motor, frequency;
231243   double track;
232   int pos;      // from the beginning of the current track!
244   int clock;
245   int start_pos, pos;      // start_pos = start of half track ; pos = position from the beginning of the current half-track!
246
233247   void *timer;
234248
235249   GCR_data gcr;
236250
251   /* c1551 specific */
252   UINT8 cpu_ddr, cpu_port;
253   void *irq_timer;
254
237255} c1551_drive_emu;
238256
239257static vc1541_drive_emu vc1541_drive_static = { 0 }, *vc1541_drive = &vc1541_drive_static;
240258static c1551_drive_emu c1551_drive_static = { 0 }, *c1551_drive = &c1551_drive_static;
241259
242260
243
244261/*******************************************
245262
246263   Format specific code
r4790r4791
329346};
330347
331348static int image_offset[IMAGE_MAX_TRACKS] = { 0 };
349static int gcr_offset[IMAGE_MAX_TRACKS] = { 0 };
332350
333
334351/*******************************************
335352
336353   Offset initialization
337354
338355*******************************************/
339356
340
341static void offset_init (int format)
357/* This is twice useful: with length = 256, it allows to determine the starting offset of each
358track in the .d64 image; with length = 368, it allows to determine the starting offset of each
359track in the GCR encoded image  */
360static void offset_init( int format, int *offset_list, int length )
342361{
343362   int i;
344363
345   /* Track # starts from 1 */
346   image_offset[0] = 0;
364   /* Track # starts from 1, hence Track k will start at image_offset[k-1] */
365   offset_list[0] = 0;
347366
348367   switch (format)
349368   {
r4790r4791
351370      case format_d64_err:
352371      case format_d67:
353372         for (i = 1; i < D64_MAX_TRACKS; i++)
354            image_offset[i] = image_offset[i - 1] + d64_sectors_per_track[i - 1] * 256;
373            offset_list[i] = offset_list[i - 1] + d64_sectors_per_track[i - 1] * length;
355374         break;
356375
357376      case format_d64_40t:
358377      case format_d64_40t_err:
359378         for (i = 1; i < D64_40T_MAX_TRACKS; i++)
360            image_offset[i] = image_offset[i - 1] + d64_sectors_per_track[i - 1] * 256;
379            offset_list[i] = offset_list[i - 1] + d64_sectors_per_track[i - 1] * length;
361380         break;
362381
363382      case format_d71:
364383      case format_d71_err:
365384         for (i = 1; i < D71_MAX_TRACKS; i++)
366            image_offset[i] = image_offset[i - 1] + d71_sectors_per_track[i - 1] * 256;
385            offset_list[i] = offset_list[i - 1] + d71_sectors_per_track[i - 1] * length;
367386         break;
368387
369388      case format_d81:
370389         for (i = 1; i < D81_MAX_TRACKS; i++)
371            image_offset[i] = image_offset[i - 1] + 40 * 256;
390            offset_list[i] = offset_list[i - 1] + 40 * length;
372391         break;
373392
374393      case format_d80:
375394         for (i = 1; i < D80_MAX_TRACKS; i++)
376            image_offset[i] = image_offset[i - 1] + d80_sectors_per_track[i - 1] * 256;
395            offset_list[i] = offset_list[i - 1] + d80_sectors_per_track[i - 1] * length;
377396         break;
378397
379398      case format_d82:
380399         for (i = 1; i < D82_MAX_TRACKS; i++)
381            image_offset[i] = image_offset[i - 1] + d82_sectors_per_track[i - 1] * 256;
400            offset_list[i] = offset_list[i - 1] + d82_sectors_per_track[i - 1] * length;
382401         break;
383402
384403      default:
r4790r4791
587606
588607/**************************************
589608
590   1541 / 1541II
609   Drive timers (aka floppy reading)
591610
592611**************************************/
593612
613static TIMER_CALLBACK(vc1541_drive_timer)
614{
615   const device_config *via_1 = devtag_get_device(machine, "_1541_via_1");
594616
595static ADDRESS_MAP_START( _1541_map, ADDRESS_SPACE_PROGRAM, 8 )
596   AM_RANGE(0x0000, 0x07ff) AM_RAM
597   AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("_1541_via_0", via_r, via_w)   /* 0 and 1 used in vc20 */   // IEC Bus
598//   AM_RANGE(0x1810, 0x189f) AM_READ(SMH_NOP)            /* for debugger */
599   AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("_1541_via_1", via_r, via_w)      // Drive
600//   AM_RANGE(0x1c10, 0x1c9f) AM_READ(SMH_NOP)            /* for debugger */
601   AM_RANGE(0xc000, 0xffff) AM_ROM
602ADDRESS_MAP_END
603
604
605static ADDRESS_MAP_START( dolphin_map, ADDRESS_SPACE_PROGRAM, 8 )
606   AM_RANGE(0x0000, 0x07ff) AM_RAM
607   AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("_1541_via_0", via_r, via_w)   /* 0 and 1 used in vc20 */
608   AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("_1541_via_1", via_r, via_w)
609   AM_RANGE(0x8000, 0x9fff) AM_RAM
610   AM_RANGE(0xa000, 0xffff) AM_ROM
611ADDRESS_MAP_END
612
613
614static TIMER_CALLBACK(drive_timer)
615{
616617   if (vc1541_drive->clock == 0)
617618   {
618619      vc1541_drive->gcr.ready = 0;
r4790r4791
620621      // or is it the way the serial port reads the sync count?!?
621622      vc1541_drive->gcr.sync = 0;
622623   
623      if (vc1541_drive->type == type_1541)
624      {
625         const device_config *via_1 = devtag_get_device(machine, "_1541_via_1");
624      cputag_set_input_line(machine, vc1541_drive->cputag, M6502_SET_OVERFLOW, 1);
625      via_ca1_w(via_1, 0, 1);
626626
627         cputag_set_input_line(machine, vc1541_drive->cputag, M6502_SET_OVERFLOW, 1);
628         via_ca1_w(via_1, 0, 1);
629      }
630
631627      vc1541_drive->clock = 1;
632628      return;
633629   }
r4790r4791
658654      vc1541_drive->gcr.sync = 0;
659655   }
660656
661   if (vc1541_drive->type == type_1541)
657   cputag_set_input_line(machine, vc1541_drive->cputag, M6502_SET_OVERFLOW, 0);
658   via_ca1_w(via_1, 0, 0);
659
660   vc1541_drive->clock = 0;
661}
662
663static TIMER_CALLBACK(c1551_drive_timer)
664{
665   if (c1551_drive->clock == 0)
662666   {
663      const device_config *via_1 = devtag_get_device(machine, "_1541_via_1");
664      cputag_set_input_line(machine, vc1541_drive->cputag, M6502_SET_OVERFLOW, 0);
665      via_ca1_w(via_1, 0, 0);
667      c1551_drive->gcr.ready = 0;
668      // why put sync back to 0 here?!? it would break the sync count, isn't it?
669      // or is it the way the serial port reads the sync count?!?
670      c1551_drive->gcr.sync = 0;
671   
672      c1551_drive->clock = 1;
673      return;
666674   }
667675
668   vc1541_drive->clock = 0;
676   // this code has 2 effects: move on the pos on the data and reset it to 0 at the end of the track!
677   // size of the track is: (# sectors in the track) * (size of sector GCR endoded)
678   // Here, size of sector is 368 because of our choices in the loading: 9 bytes of header gap & 14 bytes of sector gap
679   // We will need to set the size at loading time when adding support for G64 images
680   if (++(c1551_drive->pos) >= (d64_sectors_per_track[(int)c1551_drive->track - 1] * 368))
681      c1551_drive->pos = 0;
682   // should we check if there is a change of track? to reset the pos in that case as well?
683
684   c1551_drive->gcr.ready = 1;
685
686   // notice that if there is a sequence of more than 40 1s it correctly does not reset the sync
687   // counter until a 0 is found
688   if (c1551_drive->gcr.data[c1551_drive->pos] == 0xff)
689   {
690      c1551_drive->gcr.ones_count++;
691
692//      if (c1551_drive->gcr.ones_count == 2) // 9 ones should already mark it as a sync, even if CBM chose to use 40 of them
693      if (c1551_drive->gcr.ones_count == 5)
694         c1551_drive->gcr.sync = 1;
695   }
696   else
697   {
698      c1551_drive->gcr.ones_count = 0;
699      c1551_drive->gcr.sync = 0;
700   }
701
702   c1551_drive->clock = 0;
669703}
670704
671705
r4790r4791
844878
845879static READ8_DEVICE_HANDLER( vc1541_via1_read_porta )
846880{
847   int data = vc1541_drive->gcr.data[vc1541_drive->pos];
848   logerror("Data read: Track %.1f Pos %d\n", vc1541_drive->track, vc1541_drive->pos);
881   UINT8 data = vc1541_drive->gcr.data[vc1541_drive->start_pos + vc1541_drive->pos];
849882
883//   logerror("Data read: Track %.1f Pos %d\n", vc1541_drive->track, vc1541_drive->pos);
884
850885   DBG_LOG(device->machine, 2, "vc1541 drive", ("port a read %.2x\n", data));
851886   return data;
852887}
r4790r4791
923958            vc1541_drive->track = 35.0;
924959
925960         logerror("Track #: %.1f\n", vc1541_drive->track);
961
962         /* We now adjust the vc1541_drive->pos according to the new track */
963         /* This seems a simple way to deal with half tracks */
964         vc1541_drive->pos = 0;
965         vc1541_drive->start_pos = gcr_offset[(int)vc1541_drive->track - 1]            // starting point of Track #
966            + (int)(2 * (vc1541_drive->track - (int)vc1541_drive->track)) * 184 / 2;   // half track if needed (again, 184 comes from out loading choices)
926967      }
927968
928969      if ((vc1541_drive->motor != (data & 0x04)) || (vc1541_drive->frequency != (data & 0x60)))
r4790r4791
11081149
11091150/**************************************
11101151
1152   1541 / 1541B / 1541C / 1541II /
1153      2031 (same as 1541 but IEEE)
1154
1155**************************************/
1156
1157static ADDRESS_MAP_START( _1541_map, ADDRESS_SPACE_PROGRAM, 8 )
1158   AM_RANGE(0x0000, 0x07ff) AM_RAM
1159   AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("_1541_via_0", via_r, via_w)   /* 0 and 1 used in vc20 */   // IEC Bus
1160   AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("_1541_via_1", via_r, via_w)      // Drive
1161   AM_RANGE(0xc000, 0xffff) AM_ROM
1162ADDRESS_MAP_END
1163
1164
1165static ADDRESS_MAP_START( dolphin_map, ADDRESS_SPACE_PROGRAM, 8 )
1166   AM_RANGE(0x0000, 0x07ff) AM_RAM
1167   AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("_1541_via_0", via_r, via_w)   /* 0 and 1 used in vc20 */
1168   AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("_1541_via_1", via_r, via_w)
1169   AM_RANGE(0x8000, 0x9fff) AM_RAM
1170   AM_RANGE(0xa000, 0xffff) AM_ROM
1171ADDRESS_MAP_END
1172
1173/**************************************
1174
11111175   1570 / 1571 / 1571CR
11121176
11131177**************************************/
r4790r4791
11151179static ADDRESS_MAP_START( _1571_map, ADDRESS_SPACE_PROGRAM, 8 )
11161180   AM_RANGE(0x0000, 0x07ff) AM_RAM
11171181   AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("_1541_via_0", via_r, via_w)  /* 0 and 1 used in vc20 */
1118   AM_RANGE(0x1810, 0x189f) AM_READ(SMH_NOP) /* for debugger */
11191182   AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("_1541_via_1", via_r, via_w)
1120   AM_RANGE(0x1c10, 0x1c9f) AM_READ(SMH_NOP) /* for debugger */
11211183//   AM_RANGE(0x2000, 0x2003) // WD17xx
11221184//   AM_RANGE(0x4000, 0x400f) // CIA
1123   AM_RANGE(0xc000, 0xffff) AM_ROM
1185   AM_RANGE(0x8000, 0xffff) AM_ROM
11241186ADDRESS_MAP_END
11251187
1188// for the C128DCR Drive
1189/*
1190David Gahris provided info about differences between 128DCR and stand-alone 1571s
11261191
1192* There is no 6526 or 8521 in the drive section of the 128DCR.  I believe the
1193  5710 handles fast serial because the 5710 is a Commodore custom chip and
1194  128 fast serial is a Commodore custom protocol.  [Ed's note: Commodore lists
1195  NTE229, ECG229, SK3246A/229, and 121-Z9021 as substitutes of the 5710.]
1196
1197* There is no 177x or heat-shrink-wrapped daughterboard in the drive section
1198  of the 128DCR.  I believe the Motorola plastic quad flat-pack chip handles
1199  MFM because I am pretty sure that I have seen this chip in IBM PC drive
1200  mechanisms. 
1201
1202* The 1571cr ROM works great in 1541 mode but not at all in 1571 mode in a
1203  standalone 1571. 
1204
1205* Olaf Seibert informed me that the 1571cr ROM contains a string to the
1206  effect of "5710 (c) 1986 by c. hauck"
1207*/
1208static ADDRESS_MAP_START( _1571cr_map, ADDRESS_SPACE_PROGRAM, 8 )
1209   AM_RANGE(0x0000, 0x07ff) AM_RAM
1210   AM_RANGE(0x1800, 0x180f) AM_DEVREADWRITE("_1541_via_0", via_r, via_w)  /* 0 and 1 used in vc20 */
1211   AM_RANGE(0x1c00, 0x1c0f) AM_DEVREADWRITE("_1541_via_1", via_r, via_w)
1212//   AM_RANGE(0x2000, 0x2005) // 5710 FDC
1213//   AM_RANGE(0x400c, 0x400f) // 5710 CIA Serial Port
1214//   AM_RANGE(0x4010, 0x4017) // 5710 FDC2
1215//   AM_RANGE(0x6000, 0x7fff) // RAM shadows
1216   AM_RANGE(0x8000, 0xffff) AM_ROM
1217ADDRESS_MAP_END
1218
1219
11271220/**************************************
11281221
11291222   1581
r4790r4791
11331226static ADDRESS_MAP_START( _1581_map, ADDRESS_SPACE_PROGRAM, 8 )
11341227//   AM_RANGE(0x4000, 0x400f) // CIA
11351228//   AM_RANGE(0x6000, 0x6003) // WD17xx
1229   AM_RANGE(0x8000, 0xffff) AM_ROM
11361230ADDRESS_MAP_END
11371231
11381232
11391233/**************************************
11401234
1141   2031 / 2040 / 3040 / 4040 /
1142      1001 / 8050 / 8250
1235   1001 / 8050 / 8250
11431236
1237http://www.zimmers.net/anonftp/pub/cbm/firmware/drives/old/8050/d/8250.notes
1238
11441239**************************************/
11451240
1146static ADDRESS_MAP_START( _2031_map, ADDRESS_SPACE_PROGRAM, 8 )
1241static ADDRESS_MAP_START( sfd1001_map, ADDRESS_SPACE_PROGRAM, 8 )
11471242//   AM_RANGE(0x0200, 0x021f) // RIOT1
11481243//   AM_RANGE(0x0280, 0x029f) // RIOT2
1244   AM_RANGE(0xc000, 0xffff) AM_ROM
11491245ADDRESS_MAP_END
11501246
11511247
11521248/**************************************
11531249
1250   2040 / 3040 / 4040
1251
1252http://www.zimmers.net/anonftp/pub/cbm/schematics/drives/old/4040/memorymap.txt
1253
1254**************************************/
1255
1256static ADDRESS_MAP_START( _4040_map, ADDRESS_SPACE_PROGRAM, 8 )
1257ADDRESS_MAP_END
1258
1259
1260/**************************************
1261
11541262   1551
11551263
11561264**************************************/
r4790r4791
11831291
11841292      if (data != old)
11851293      {
1186         DBG_LOG(space->machine, 1, "vc1541 drive",("%.2x\n", data));
1294         DBG_LOG(space->machine, 1, "c1551 drive",("%.2x\n", data));
11871295     
11881296         if ((old & 0x03) != (data & 0x03))
11891297         {
r4790r4791
12231331               c1551_drive->track = 1.0;
12241332            if (c1551_drive->track > 35)
12251333               c1551_drive->track = 35.0;
1334
1335         logerror("Track #: %.1f\n", c1551_drive->track);
1336
1337         /* We now adjust the c1551_drive->pos according to the new track */
1338         /* This seems a simple way to deal with half tracks */
1339         c1551_drive->pos = 0;
1340         c1551_drive->start_pos = gcr_offset[(int)c1551_drive->track - 1]            // starting point of Track #
1341            + (int)(2 * (c1551_drive->track - (int)c1551_drive->track)) * 184 / 2;   // half track if needed (again, 184 comes from out loading choices)
12261342         }
12271343
12281344         if ( (c1551_drive->motor != (data & 0x04)) || (c1551_drive->frequency != (data & 0x60)) )
r4790r4791
12841400   return data;
12851401}
12861402
1403
1404static ADDRESS_MAP_START( _1551_map, ADDRESS_SPACE_PROGRAM, 8 )
1405    AM_RANGE(0x0000, 0x0001) AM_READWRITE(c1551_port_r, c1551_port_w)
1406   AM_RANGE(0x0002, 0x07ff) AM_RAM
1407    AM_RANGE(0x4000, 0x4007) AM_DEVREADWRITE("c1551_tpi", tpi6525_r, tpi6525_w)
1408   AM_RANGE(0xc000, 0xffff) AM_ROM
1409ADDRESS_MAP_END
1410
1411
1412/******************** Handlers for the C1551 TPI ********************/
1413
12871414/*
12881415   tia6523
12891416   port a
r4790r4791
13141441
13151442static READ8_DEVICE_HANDLER( c1551_port_b_r )
13161443{
1317   int data = c1551_drive->gcr.data[c1551_drive->pos];
1444   UINT8 data = c1551_drive->gcr.data[c1551_drive->start_pos + c1551_drive->pos];
13181445
13191446   DBG_LOG(device->machine, 2, "c1551 drive",("port a read %.2x\n", data));
13201447   return data;
13211448}
13221449
1450static const tpi6525_interface c1551_tpi_intf =
1451{
1452   NULL,
1453   c1551_port_b_r,
1454   c1551_port_c_r,
1455   NULL,
1456   NULL,
1457   NULL,
1458   NULL,
1459   NULL,
1460   NULL
1461};
13231462
1324static ADDRESS_MAP_START( _1551_map, ADDRESS_SPACE_PROGRAM, 8 )
1325    AM_RANGE(0x0000, 0x0001) AM_READWRITE(c1551_port_r, c1551_port_w)
1326   AM_RANGE(0x0002, 0x07ff) AM_RAM
1327    AM_RANGE(0x4000, 0x4007) AM_DEVREADWRITE("c1551_tpi", tpi6525_r, tpi6525_w)
1328   AM_RANGE(0xc000, 0xffff) AM_ROM
1329ADDRESS_MAP_END
13301463
1464/******************** Handlers for the C16 TPI ********************/
13311465
13321466WRITE8_DEVICE_HANDLER( c1551x_write_data )
13331467{
r4790r4791
13351469#ifdef CPU_SYNC
13361470   cpu_sync();
13371471#endif
1338   tpi6525_porta_w(device, 0, data);
1472   const device_config *tpi_0 = devtag_get_device(device->machine, "c1551_tpi");
1473
1474   tpi6525_porta_w(tpi_0, 0, data);
13391475}
13401476
13411477READ8_DEVICE_HANDLER( c1551x_read_data )
13421478{
1343   int data = 0xff;
1479   UINT8 data = 0xff;
1480   const device_config *tpi_0 = devtag_get_device(device->machine, "c1551_tpi");
1481
13441482#ifdef CPU_SYNC
13451483   cpu_sync ();
13461484#endif
13471485
1348   data = tpi6525_porta_r(device, 0);
1486   data = tpi6525_porta_r(tpi_0, 0);
13491487//   DBG_LOG(device->machine, 2, "c1551 cpu",("%d read data %.2x\n", cpu_getactivecpu (), data));
13501488   return data;
13511489}
13521490
13531491WRITE8_DEVICE_HANDLER( c1551x_write_handshake )
13541492{
1493   const device_config *tpi_0 = devtag_get_device(device->machine, "c1551_tpi");
13551494//   DBG_LOG(device->machine, 1, "c1551 cpu",("%d write handshake %.2x\n", cpu_getactivecpu (), data));
13561495#ifdef CPU_SYNC
13571496   cpu_sync();
13581497#endif
13591498
1360   tpi6525_portc_w(device, 0, data & 0x40 ? 0xff : 0x7f);
1499   tpi6525_portc_w(tpi_0, 0, data & 0x40 ? 0xff : 0x7f);
13611500}
13621501
13631502READ8_DEVICE_HANDLER( c1551x_read_handshake )
13641503{
1365   int data = 0xff;
1504   const device_config *tpi_0 = devtag_get_device(device->machine, "c1551_tpi");
1505   UINT8 data = 0xff;
13661506#ifdef CPU_SYNC
13671507   cpu_sync();
13681508#endif
13691509
1370   data = tpi6525_portc_r(device, 0) & 0x08 ? 0x80 : 0x00;
1510   data = tpi6525_portc_r(tpi_0, 0) & 0x08 ? 0x80 : 0x00;
13711511//   DBG_LOG(device->machine, 2, "c1551 cpu",("%d read handshake %.2x\n", cpu_getactivecpu (), data));
13721512   return data;
13731513}
13741514
13751515READ8_DEVICE_HANDLER( c1551x_read_status )
13761516{
1377   int data = 0xff;
1517   const device_config *tpi_0 = devtag_get_device(device->machine, "c1551_tpi");
1518   UINT8 data = 0xff;
13781519#ifdef CPU_SYNC
13791520   cpu_sync();
13801521#endif
13811522
1382   data = tpi6525_portc_r(device, 0) & 0x03;
1523   data = tpi6525_portc_r(tpi_0, 0) & 0x03;
13831524//   DBG_LOG(device->machine, 1, "c1551 cpu",("%d read status %.2x\n", cpu_getactivecpu (), data));
13841525
13851526   return data;
13861527}
13871528
13881529
1530
13891531/**************************************
13901532
1533   Machine drivers
1534
1535**************************************/
1536
1537
1538MACHINE_DRIVER_START( cpu_vc1540 )
1539   MDRV_CPU_ADD("cpu_vc1540", M6502, XTAL_16_MHz / 16)
1540   MDRV_CPU_PROGRAM_MAP(_1541_map)
1541
1542   MDRV_VIA6522_ADD("_1541_via_0", 0, vc1541_via0)
1543   MDRV_VIA6522_ADD("_1541_via_1", 0, vc1541_via1)
1544MACHINE_DRIVER_END
1545
1546MACHINE_DRIVER_START( cpu_vc1541 )
1547   MDRV_IMPORT_FROM(cpu_vc1540)
1548MACHINE_DRIVER_END
1549
1550MACHINE_DRIVER_START( cpu_c1571 )
1551   MDRV_CPU_ADD("cpu_vc1571", M6502, XTAL_16_MHz / 16)
1552   MDRV_CPU_PROGRAM_MAP(_1571_map)
1553
1554   MDRV_VIA6522_ADD("_1541_via_0", 0, vc1541_via0)
1555   MDRV_VIA6522_ADD("_1541_via_1", 0, vc1541_via1)
1556MACHINE_DRIVER_END
1557
1558MACHINE_DRIVER_START( cpu_c1571cr )
1559   MDRV_CPU_ADD("cpu_vc1571", M6502, XTAL_16_MHz / 16)
1560   MDRV_CPU_PROGRAM_MAP(_1571cr_map)
1561
1562   MDRV_VIA6522_ADD("_1541_via_0", 0, vc1541_via0)
1563   MDRV_VIA6522_ADD("_1541_via_1", 0, vc1541_via1)
1564MACHINE_DRIVER_END
1565
1566MACHINE_DRIVER_START( cpu_c1581 )
1567   MDRV_IMPORT_FROM(cpu_c1571)      // obviously incorrect: we need proper 1581 memory map and emulation!
1568MACHINE_DRIVER_END
1569
1570MACHINE_DRIVER_START( cpu_c2031 )
1571   MDRV_IMPORT_FROM(cpu_vc1540)   // not sure the memory map is exactly the vc1541 one!
1572MACHINE_DRIVER_END
1573
1574MACHINE_DRIVER_START( cpu_dolphin )
1575   MDRV_CPU_ADD("cpu_dolphin", M6502, XTAL_16_MHz / 16)
1576   MDRV_CPU_PROGRAM_MAP(dolphin_map)
1577MACHINE_DRIVER_END
1578
1579MACHINE_DRIVER_START( cpu_c1551 )
1580   MDRV_CPU_ADD("cpu_c1551", M6510T, 2000000)
1581   MDRV_CPU_PROGRAM_MAP(_1551_map)
1582
1583   /* tpi */
1584   MDRV_TPI6525_ADD("c1551_tpi", c1551_tpi_intf)
1585MACHINE_DRIVER_END
1586
1587
1588
1589/**************************************
1590
13911591   Drive init & reset
13921592
13931593**************************************/
13941594
1395int drive_config( running_machine *machine, int type, int id, int mode, const char *cputag, int devicenr )
1595void drive_config( running_machine *machine, int type, int id, int mode, const char *cputag, int devicenr )
13961596{
13971597   vc1541_drive->type = type;
13981598   vc1541_drive->cputag = cputag;
13991599   vc1541_drive->vc1541_serial.deviceid = devicenr;
1400   vc1541_drive->timer = timer_alloc(machine, drive_timer, NULL);
1401
1402   return 0;
1600   vc1541_drive->timer = timer_alloc(machine, vc1541_drive_timer, NULL);
14031601}
14041602
14051603void c1551_config( running_machine *machine, const char *cputag )
14061604{
1605   c1551_drive->type = type_1551;
14071606   c1551_drive->cputag = cputag;
1607   c1551_drive->timer = timer_alloc(machine, c1551_drive_timer, NULL);
14081608
14091609   /* time should be small enough to allow quitting of the irq
14101610   line before the next interrupt is triggered */
r4790r4791
14241624      }
14251625   }
14261626
1427   vc1541_drive->track = 1.0;
1428}
1627   /* Create offset map for GCR encoded images: it speeds up finding position where to read data from */
1628   switch (vc1541_drive->type)
1629   {
1630      case type_1541:
1631      case type_1541ii:
1632         offset_init(format_d64_40t, gcr_offset, 368);   // offset map is the same for both 35 and 40 track discs
1633         break;
14291634
1635      case type_1570:
1636      case type_1571:
1637      case type_1571cr:
1638         offset_init(format_d71, gcr_offset, 368);
1639         break;
14301640
1431/**************************************
1641      case type_1581:
1642         offset_init(format_d81, gcr_offset, 368);
1643         break;
14321644
1433   Machine drivers
1645      default:
1646         logerror("GCR offset map not created\n");
1647   }
14341648
1435**************************************/
1649   vc1541_drive->track = 1.0;
1650   vc1541_drive->start_pos = 0;
1651   vc1541_drive->pos = 0;
1652}
14361653
1437static const tpi6525_interface c1551_tpi_intf =
1654void c1551_drive_reset (void)
14381655{
1439   NULL,
1440   c1551_port_b_r,
1441   c1551_port_c_r,
1442   NULL,
1443   NULL,
1444   NULL,
1445   NULL,
1446   NULL,
1447   NULL
1448};
1656   offset_init(format_d64_40t, gcr_offset, 368);   // offset map is the same for both 35 and 40 track discs
1657   c1551_drive->track = 1.0;
1658   c1551_drive->start_pos = 0;
1659   c1551_drive->pos = 0;
1660}
14491661
14501662
1451MACHINE_DRIVER_START( cpu_vc1540 )
1452   MDRV_CPU_ADD("cpu_vc1540", M6502, XTAL_16_MHz / 16)
1453   MDRV_CPU_PROGRAM_MAP(_1541_map)
14541663
1455   MDRV_VIA6522_ADD("_1541_via_0", 0, vc1541_via0)
1456   MDRV_VIA6522_ADD("_1541_via_1", 0, vc1541_via1)
1457MACHINE_DRIVER_END
1458
1459MACHINE_DRIVER_START( cpu_vc1541 )
1460   MDRV_IMPORT_FROM(cpu_vc1540)
1461MACHINE_DRIVER_END
1462
1463MACHINE_DRIVER_START( cpu_c2031 )
1464   MDRV_IMPORT_FROM(cpu_vc1540)
1465MACHINE_DRIVER_END
1466
1467MACHINE_DRIVER_START( cpu_dolphin )
1468   MDRV_CPU_ADD("cpu_dolphin", M6502, XTAL_16_MHz / 16)
1469   MDRV_CPU_PROGRAM_MAP(dolphin_map)
1470MACHINE_DRIVER_END
1471
1472MACHINE_DRIVER_START( cpu_c1551 )
1473   MDRV_CPU_ADD("cpu_c1551", M6510T, 2000000)
1474   MDRV_CPU_PROGRAM_MAP(_1551_map)
1475
1476   /* tpi */
1477   MDRV_TPI6525_ADD("c1551_tpi", c1551_tpi_intf)
1478MACHINE_DRIVER_END
1479
1480MACHINE_DRIVER_START( cpu_c1571 )
1481   MDRV_CPU_ADD("cpu_vc1540", M6502, XTAL_16_MHz / 16)
1482   MDRV_CPU_PROGRAM_MAP(_1571_map)
1483
1484   MDRV_VIA6522_ADD("_1541_via_0", 0, vc1541_via0)
1485   MDRV_VIA6522_ADD("_1541_via_1", 0, vc1541_via1)
1486MACHINE_DRIVER_END
1487
1488
14891664/**************************************
14901665
14911666   Device configurations
r4790r4791
16621837   }
16631838   
16641839   /* Set up track / sector map according to the format of the image */
1665   offset_init (format);
1840   offset_init(format, image_offset, 256);
16661841
16671842   /* Claim memory */
16681843   temp_copy = auto_alloc_array(image->machine, UINT8, filesize);
r4790r4791
17211896   }
17221897   
17231898   /* Set up track / sector map according to the format of the image */
1724   offset_init (format);
1899   offset_init(format, image_offset, 256);
17251900
17261901   /* Claim memory */
17271902   temp_copy = auto_alloc_array(image->machine, UINT8, filesize);
src/mess/machine/c128.c
r4790r4791
7979static int c128_cia1_on = 1;
8080static UINT8 serial_clock, serial_data, serial_atn;
8181static UINT8 vicirq = 0;
82static int emulated_drive = 0;
8283
8384static void c128_nmi(running_machine *machine)
8485{
r4790r4791
11571158DRIVER_INIT( c128d )
11581159{
11591160   DRIVER_INIT_CALL( c128 );
1160   drive_config(machine, type_1541, 0, 0, "cpu_vc1540", 8);
1161   emulated_drive = 1;
1162   drive_config(machine, type_1571, 0, 0, "cpu_vc1571", 8);
11611163}
11621164
11631165DRIVER_INIT( c128dpal )
11641166{
1165   DRIVER_INIT_CALL( c128d );
1166   drive_config(machine, type_1541, 0, 0, "cpu_vc1540", 8);
1167   DRIVER_INIT_CALL( c128pal );
1168   emulated_drive = 1;
1169   drive_config(machine, type_1571, 0, 0, "cpu_vc1571", 8);
11671170}
11681171
1172DRIVER_INIT( c128dcr )
1173{
1174   DRIVER_INIT_CALL( c128 );
1175   emulated_drive = 1;
1176   drive_config(machine, type_1571cr, 0, 0, "cpu_vc1571", 8);
1177}
1178
1179DRIVER_INIT( c128dcrp )
1180{
1181   DRIVER_INIT_CALL( c128pal );
1182   emulated_drive = 1;
1183   drive_config(machine, type_1571cr, 0, 0, "cpu_vc1571", 8);
1184}
1185
1186DRIVER_INIT( c128d81 )
1187{
1188   DRIVER_INIT_CALL( c128 );
1189   emulated_drive = 1;
1190   drive_config(machine, type_1581, 0, 0, "cpu_vc1571", 8);
1191}
1192
11691193MACHINE_START( c128 )
11701194{
1171   if (c128_cia1_on)
1195   if (emulated_drive)
11721196   {
1197      cbm_serial_config(machine, &cbm_emu_drive_interface);
1198      drive_reset();
1199   }
1200   else if (c128_cia1_on)
1201   {
11731202      cbm_serial_config(machine, &cbm_sim_drive_interface);
11741203      cbm_serial_reset_write(machine, 0);
11751204      cbm_drive_0_config(SERIAL, 8);
src/mess/machine/c16.c
r4790r4791
560560      memory_install_write8_handler(space, 0xfec0, 0xfedf, 0, 0, SMH_NOP);
561561      memory_install_read8_handler(space, 0xfec0, 0xfedf, 0, 0, SMH_NOP);
562562   }
563
563   if (has_c1551)      /* c1551 */
564   {
565      c1551_drive_reset();
566   }
564567   if (has_vc1541)      /* vc1541 */
565568   {
566      cbm_serial_config(machine, &cbm_fake_drive_interface);
569      cbm_serial_config(machine, &cbm_emu_drive_interface);
567570      drive_reset();
568571   }
569572   else                        /* simulated drives */
src/mess/machine/vc20.c
r4790r4791
604604   has_vc1541 = 1;
605605   vc20_common_driver_init(machine);
606606   vic6560_init(vic6560_dma_read, vic6560_dma_read_color);
607   drive_config(machine, type_1541, 0, 0, "cpu_vc1540", 8);
607608}
608609
609610DRIVER_INIT( vic20i )
r4790r4791
620621
621622   if (has_vc1541)
622623   {
623      cbm_serial_config(machine, &cbm_fake_drive_interface);
624      cbm_serial_config(machine, &cbm_emu_drive_interface);
624625      drive_reset();
625626   }
626627   else
src/mess/drivers/c128.c
r4790r4791
644644   MDRV_IMPORT_FROM( cpu_c1571 )
645645MACHINE_DRIVER_END
646646
647static MACHINE_DRIVER_START( c128dcr )
648   MDRV_IMPORT_FROM( c128 )
649   MDRV_IMPORT_FROM( cpu_c1571cr )
650MACHINE_DRIVER_END
647651
652static MACHINE_DRIVER_START( c128d81 )
653   MDRV_IMPORT_FROM( c128 )
654   MDRV_IMPORT_FROM( cpu_c1581 )
655MACHINE_DRIVER_END
656
657
648658static MACHINE_DRIVER_START( c128pal )
649659   MDRV_IMPORT_FROM( c128 )
650660   MDRV_CPU_REPLACE( "maincpu", Z80, VIC6569_CLOCK )
r4790r4791
671681   MDRV_IMPORT_FROM( cpu_c1571 )
672682MACHINE_DRIVER_END
673683
684static MACHINE_DRIVER_START( c128dcrp )
685   MDRV_IMPORT_FROM( c128pal )
686   MDRV_IMPORT_FROM( cpu_c1571cr )
687MACHINE_DRIVER_END
674688
675689
690
676691/*************************************
677692 *
678693 *  ROM definition(s)
r4790r4791
740755   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
741756ROM_END
742757
743ROM_START( c128fin )
758ROM_START( c128sfi )
744759   ROM_REGION( 0x132800, "maincpu", 0 )
760   ROM_LOAD( "318018-0x.u33", 0x100000, 0x4000, CRC(2ee6e2fa) SHA1(60e1491e1d5782e3cf109f518eb73427609badc6) )      // labels not available
761   ROM_LOAD( "318019-0x.u34", 0x104000, 0x4000, CRC(d551fce0) SHA1(4d223883e866645328f86a904b221464682edc4f) )      // labels not available
762   ROM_LOAD( "251913-0x.u32", 0x108000, 0x4000, CRC(2aff27d3) SHA1(267654823c4fdf2167050f41faa118218d2569ce) )      // labels not available
763   ROM_LOAD( "318020-0x.u35", 0x10c000, 0x4000, CRC(9526fac4) SHA1(a01dd871241c801db51e8ebc30fedfafd8cc506b) )      // labels not available
764
765   /* This was not included in the submission, unfortunately */
766   ROM_LOAD( "325181-01.bin", 0x120000, 0x2000, BAD_DUMP CRC(7a70d9b8) SHA1(aca3f7321ee7e6152f1f0afad646ae41964de4fb) )
767
768   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
769   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
770   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
771ROM_END
772
773ROM_START( c128fino )
774   ROM_REGION( 0x132800, "maincpu", 0 )
745775   ROM_LOAD( "318018-04.bin", 0x100000, 0x4000, BAD_DUMP CRC(9f9c355b) SHA1(d53a7884404f7d18ebd60dd3080c8f8d71067441) )         // BASIC lo
746776   ROM_LOAD( "318019-04.bin", 0x104000, 0x4000, BAD_DUMP CRC(6e2c91a7) SHA1(c4fb4a714e48a7bf6c28659de0302183a0e0d6c0) )         // BASIC hi
747777   ROM_LOAD( "251913-01.bin", 0x108000, 0x4000, BAD_DUMP CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88) )         // C64 OS ROM
r4790r4791
804834   ROM_LOAD( "390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) )
805835
806836   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
807   C1571_ROM("cpu_vc1540")
837   C1571_ROM("cpu_vc1571")
808838   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
809839   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
810840ROM_END
r4790r4791
819849   ROM_LOAD( "390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) )         // Character
820850
821851   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
822   C1571_ROM("cpu_vc1540")
852   C1571CR_ROM("cpu_vc1571")
823853   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
824854   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
825855ROM_END
r4790r4791
834864   ROM_LOAD( "315079-01.bin", 0x120000, 0x2000, CRC(fe5a2db1) SHA1(638f8aff51c2ac4f99a55b12c4f8c985ef4bebd3) )
835865
836866   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
837   C1571_ROM("cpu_vc1540")
867   C1571CR_ROM("cpu_vc1571")
838868   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
839869   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
840870ROM_END
r4790r4791
847877   ROM_LOAD( "325181-01.bin", 0x120000, 0x2000, CRC(7a70d9b8) SHA1(aca3f7321ee7e6152f1f0afad646ae41964de4fb) )
848878
849879   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
850   C1571_ROM("cpu_vc1540")
880   C1571CR_ROM("cpu_vc1571")
851881   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
852882   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
853883ROM_END
r4790r4791
863893   ROM_LOAD( "325167-01.bin", 0x120000, 0x2000, BAD_DUMP CRC(bad36b88) SHA1(9119b27a1bf885fa4c76fff5d858c74c194dd2b8) )
864894
865895   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
866   C1571_ROM("cpu_vc1540")
896   C1571CR_ROM("cpu_vc1571")
867897   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
868898   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
869899ROM_END
870900
871901
902ROM_START( c128d81 )
903   ROM_REGION( 0x132800, "maincpu", 0 )
904   ROM_LOAD( "318018-04.bin", 0x100000, 0x4000, CRC(9f9c355b) SHA1(d53a7884404f7d18ebd60dd3080c8f8d71067441) )         // BASIC lo
905   ROM_LOAD( "318019-04.bin", 0x104000, 0x4000, CRC(6e2c91a7) SHA1(c4fb4a714e48a7bf6c28659de0302183a0e0d6c0) )         // BASIC hi
906   ROM_LOAD( "251913-01.bin", 0x108000, 0x4000, CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88) )         // C64 OS ROM
907   ROM_LOAD( "318020-05.bin", 0x10c000, 0x4000, CRC(ba456b8e) SHA1(ceb6e1a1bf7e08eb9cbc651afa29e26adccf38ab) )         // Kernal
908   ROM_LOAD( "390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) )
872909
910   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
911   C1581_ROM("cpu_vc1571")
912   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
913   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
914ROM_END
915
916
917
873918/*************************************
874919 *
875920 *  System configuration(s)
r4790r4791
885930   CONFIG_DEVICE(c1571_device_getinfo)
886931SYSTEM_CONFIG_END
887932
933static SYSTEM_CONFIG_START(c128d81)
934   CONFIG_DEVICE(c1581_device_getinfo)
935SYSTEM_CONFIG_END
888936
937
889938/***************************************************************************
890939
891940  Game driver(s)
r4790r4791
894943
895944/*    YEAR  NAME     PARENT COMPAT MACHINE   INPUT    INIT      CONFIG COMPANY                             FULLNAME            FLAGS */
896945
897COMP( 1985, c128,      0,     0,   c128,     c128,    c128,     c128,  "Commodore Business Machines Co.", "Commodore 128 NTSC", 0)
946COMP( 1985, c128,      0,     0,   c128,     c128,    c128,     c128,  "Commodore Business Machines Co.", "Commodore 128 (NTSC)", 0)
898947COMP( 1985, c128cr,    c128,  0,   c128,     c128,    c128,     c128,  "Commodore Business Machines Co.", "Commodore 128CR (NTSC, proto?)", 0)
899948
900COMP( 1985, c128fin,   c128,  0,   c128pal,  c128swe, c128pal,  c128,  "Commodore Business Machines Co.", "Commodore 128 (PAL, Finland)", 0)
949COMP( 1985, c128sfi,   c128,  0,   c128pal,  c128fra, c128pal,  c128,  "Commodore Business Machines Co.", "Commodore 128 (PAL, Swedish / Finnish)", 0)
950COMP( 1985, c128fino,  c128,  0,   c128pal,  c128swe, c128pal,  c128,  "Commodore Business Machines Co.", "Commodore 128 (PAL, Finland, Unconfirmed Dumps)", 0)
901951COMP( 1985, c128fra,   c128,  0,   c128pal,  c128fra, c128pal,  c128,  "Commodore Business Machines Co.", "Commodore 128 (PAL, France)", 0)
902952COMP( 1985, c128ger,   c128,  0,   c128pal,  c128ger, c128pal,  c128,  "Commodore Business Machines Co.", "Commodore 128 (PAL, Germany)", 0)
903953COMP( 1985, c128nor,   c128,  0,   c128pal,  c128ita, c128pal,  c128,  "Commodore Business Machines Co.", "Commodore 128 (PAL, Norway)", 0)
904/* other countries spain, belgium, ... */
954// we miss other countries: Spain, Belgium, etc.
905955
956// the following drivers use a 1571 floppy drive
906957COMP( 1985, c128dpr,   c128,  0,   c128d,    c128,    c128d,    c128d, "Commodore Business Machines Co.", "Commodore 128D (NTSC, proto)", GAME_NOT_WORKING)
907COMP( 1985, c128d,     c128,  0,   c128dpal, c128,    c128dpal, c128d, "Commodore Business Machines Co.", "Commodore 128D PAL", GAME_NOT_WORKING)
958COMP( 1985, c128d,     c128,  0,   c128dpal, c128,    c128dpal, c128d, "Commodore Business Machines Co.", "Commodore 128D (PAL)", GAME_NOT_WORKING)
908959
909COMP( 1986, c128dcr,   c128,  0,   c128d,    c128,    c128d,    c128d, "Commodore Business Machines Co.", "Commodore 128DCR NTSC", GAME_NOT_WORKING)
910COMP( 1986, c128drde,  c128,  0,   c128dpal, c128ger, c128dpal, c128d, "Commodore Business Machines Co.", "Commodore 128DCR (PAL, Germany)", GAME_NOT_WORKING)
911COMP( 1986, c128drit,  c128,  0,   c128dpal, c128ita, c128dpal, c128d, "Commodore Business Machines Co.", "Commodore 128DCR (PAL, Italy)", GAME_NOT_WORKING)
912COMP( 1986, c128drsw,  c128,  0,   c128dpal, c128swe, c128dpal, c128d, "Commodore Business Machines Co.", "Commodore 128DCR (PAL, Sweden)", GAME_NOT_WORKING)
913//COMP( 1986, c128d81,   c128,  0,   c128d,    c128,    c128d,    c128d, "Commodore Business Machines Co.", "Commodore "128D/81" NTSC", GAME_NOT_WORKING) // no floppy drive emulation makes this useless atm
960// the following drivers use a 1571CR floppy drive
961COMP( 1986, c128dcr,   c128,  0,   c128dcr,  c128,    c128dcr,  c128d, "Commodore Business Machines Co.", "Commodore 128DCR (NTSC)", GAME_NOT_WORKING)
962COMP( 1986, c128drde,  c128,  0,   c128dcrp, c128ger, c128dcrp, c128d, "Commodore Business Machines Co.", "Commodore 128DCR (PAL, Germany)", GAME_NOT_WORKING)
963COMP( 1986, c128drit,  c128,  0,   c128dcrp, c128ita, c128dcrp, c128d, "Commodore Business Machines Co.", "Commodore 128DCR (PAL, Italy)", GAME_NOT_WORKING)
964COMP( 1986, c128drsw,  c128,  0,   c128dcrp, c128swe, c128dcrp, c128d, "Commodore Business Machines Co.", "Commodore 128DCR (PAL, Sweden)", GAME_NOT_WORKING)
965
966// 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
967COMP( 1986, c128d81,   c128,  0,   c128d81,  c128,    c128d81,  c128d81, "Commodore Business Machines Co.", "Commodore 128D/81 (NTSC, proto)", GAME_NOT_WORKING)
src/mess/drivers/c16.c
r4790r4791
461461   MDRV_IMPORT_FROM( c16 )
462462
463463   /* 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 */
464   still in progress, atm */
466465   MDRV_TPI6525_REMOVE("tpi6535_tpi_2")
467466   MDRV_TPI6525_ADD("tpi6535_tpi_2", c16_tpi6525_tpi_2_c1551_intf)
468467
r4790r4791
509508   MDRV_IMPORT_FROM( plus4 )
510509
511510   /* 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 */
511   still in progress, atm */
514512   MDRV_TPI6525_REMOVE("tpi6535_tpi_2")
515513   MDRV_TPI6525_ADD("tpi6535_tpi_2", c16_tpi6525_tpi_2_c1551_intf)
516514
r4790r4791
565563 *************************************/
566564
567565ROM_START( c232 )
568   ROM_REGION (0x40000, "maincpu", 0)
566   ROM_REGION( 0x40000, "maincpu", 0 )
569567   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
570568   ROM_LOAD( "318004-01.bin", 0x14000, 0x4000, CRC(dbdc3319) SHA1(3c77caf72914c1c0a0875b3a7f6935cd30c54201) )
571569ROM_END
572570
573571ROM_START( c264 )
574   ROM_REGION (0x40000, "maincpu", 0)
572   ROM_REGION( 0x40000, "maincpu", 0 )
575573   ROM_LOAD( "basic-264.bin", 0x10000, 0x4000, CRC(6a2fc8e3) SHA1(473fce23afa07000cdca899fbcffd6961b36a8a0) )
576574   ROM_LOAD( "kernal-264.bin", 0x14000, 0x4000, CRC(8f32abe7) SHA1(d481faf5fcbb331878dc7851c642d04f26a32873) )
577575ROM_END
578576
579577ROM_START( c364 )
580   ROM_REGION (0x40000, "maincpu", 0)
578   ROM_REGION( 0x40000, "maincpu", 0 )
581579   ROM_LOAD( "318006.01", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
582580   ROM_LOAD( "kern364p.bin", 0x14000, 0x4000, CRC(84fd4f7a) SHA1(b9a5b5dacd57ca117ef0b3af29e91998bf4d7e5f) )
583581   ROM_LOAD( "317053-01.bin", 0x18000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f) )
r4790r4791
588586
589587
590588ROM_START( c16 )
591   ROM_REGION (0x40000, "maincpu", 0)
589   ROM_REGION( 0x40000, "maincpu", 0 )
592590   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
593591   ROM_SYSTEM_BIOS( 0, "default", "rev. 5" )
594592   ROMX_LOAD( "318004-05.bin", 0x14000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb), ROM_BIOS(1) )
r4790r4791
599597ROM_END
600598
601599ROM_START( c16c )
602   ROM_REGION (0x40000, "maincpu", 0)
600   ROM_REGION( 0x40000, "maincpu", 0 )
603601   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
604602   ROM_SYSTEM_BIOS( 0, "default", "rev. 5" )
605603   ROMX_LOAD( "318004-05.bin", 0x14000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb), ROM_BIOS(1) )
r4790r4791
608606   ROM_SYSTEM_BIOS( 2, "rev4", "rev. 4" )
609607   ROMX_LOAD( "318004-04.bin", 0x14000, 0x4000, CRC(be54ed79) SHA1(514ad3c29d01a2c0a3b143d9c1d4143b1912b793), ROM_BIOS(3) )
610608
611   C1551_ROM ("cpu_c1551")
609   C1551_ROM("cpu_c1551")
612610ROM_END
613611
614612ROM_START( c16v )
615   ROM_REGION (0x40000, "maincpu", 0)
613   ROM_REGION( 0x40000, "maincpu", 0 )
616614   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
617   ROM_SYSTEM_BIOS( 0, "default", "rev. 5" )
618   ROMX_LOAD( "318004-05.bin", 0x14000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb), ROM_BIOS(1) )
619   ROM_SYSTEM_BIOS( 1, "rev3", "rev. 3" )
620   ROMX_LOAD( "318004-03.bin", 0x14000, 0x4000, CRC(77bab934) SHA1(97814dab9d757fe5a3a61d357a9a81da588a9783), ROM_BIOS(2) )
621   ROM_SYSTEM_BIOS( 2, "rev4", "rev. 4" )
622   ROMX_LOAD( "318004-04.bin", 0x14000, 0x4000, CRC(be54ed79) SHA1(514ad3c29d01a2c0a3b143d9c1d4143b1912b793), ROM_BIOS(3) )
615   ROM_LOAD( "318004-05.bin", 0x14000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb) )
623616
624   VC1541_ROM ("cpu_vc1540")
617   /* we temporarily use -bios to select among vc1541 firmwares, for this system */
618   VC1541_ROM("cpu_vc1540")
625619ROM_END
626620
627621#define rom_c116      rom_c16
r4790r4791
629623#define rom_c116v      rom_c16v
630624
631625ROM_START( c16hun )
632   ROM_REGION (0x40000, "maincpu", 0)
626   ROM_REGION( 0x40000, "maincpu", 0 )
633627   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
634628   ROM_LOAD( "hungary.bin", 0x14000, 0x4000, CRC(775f60c5) SHA1(20cf3c4bf6c54ef09799af41887218933f2e27ee) )
635629ROM_END
636630
637631ROM_START( plus4 )
638   ROM_REGION (0x40000, "maincpu", 0)
632   ROM_REGION( 0x40000, "maincpu", 0 )
639633   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
640634   ROM_SYSTEM_BIOS( 0, "default", "rev. 5" )
641635   ROMX_LOAD( "318005-05.bin", 0x14000, 0x4000, CRC(70295038) SHA1(a3d9e5be091b98de39a046ab167fb7632d053682), ROM_BIOS(1) )
r4790r4791
647641ROM_END
648642
649643ROM_START( plus4c )
650   ROM_REGION (0x40000, "maincpu", 0)
644   ROM_REGION( 0x40000, "maincpu", 0 )
651645   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
652646   ROM_SYSTEM_BIOS( 0, "default", "rev. 5" )
653647   ROMX_LOAD( "318005-05.bin", 0x14000, 0x4000, CRC(70295038) SHA1(a3d9e5be091b98de39a046ab167fb7632d053682), ROM_BIOS(1) )
r4790r4791
657651   ROM_LOAD( "317053-01.bin", 0x18000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f) )
658652   ROM_LOAD( "317054-01.bin", 0x1c000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693) )
659653
660   C1551_ROM ("cpu_c1551")
654   C1551_ROM("cpu_c1551")
661655ROM_END
662656
663657ROM_START( plus4v )
664   ROM_REGION (0x40000, "maincpu", 0)
658   ROM_REGION( 0x40000, "maincpu", 0 )
665659   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
666   ROM_SYSTEM_BIOS( 0, "default", "rev. 5" )
667   ROMX_LOAD( "318005-05.bin", 0x14000, 0x4000, CRC(70295038) SHA1(a3d9e5be091b98de39a046ab167fb7632d053682), ROM_BIOS(1) )
668   ROM_SYSTEM_BIOS( 1, "rev4", "rev. 4" )
669   ROMX_LOAD( "318005-04.bin", 0x14000, 0x4000, CRC(799a633d) SHA1(5df52c693387c0e2b5d682613a3b5a65477311cf), ROM_BIOS(2) )
660   ROM_LOAD( "318005-05.bin", 0x14000, 0x4000, CRC(70295038) SHA1(a3d9e5be091b98de39a046ab167fb7632d053682) )
670661
671662   ROM_LOAD( "317053-01.bin", 0x18000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f) )
672663   ROM_LOAD( "317054-01.bin", 0x1c000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693) )
673664
674   VC1541_ROM ("cpu_vc1540")
665   /* we temporarily use -bios to select among vc1541 firmwares, for this system */
666   VC1541_ROM("cpu_vc1540")
675667ROM_END
676668
677669
src/mess/drivers/vc20.c
r4790r4791
310310
311311static MACHINE_DRIVER_START( vic20i )
312312   MDRV_IMPORT_FROM( vic20 )
313   /*MDRV_IMPORT_FROM( cpu_c2031 )*/
313   /* MDRV_IMPORT_FROM( cpu_c2031 ) */ // not emulated yet, we only include the firmware below
314314#if 1 || CPU_SYNC
315315   MDRV_QUANTUM_TIME(HZ(60))
316316#else
r4790r4791
318318#endif
319319
320320   MDRV_CPU_MODIFY( "maincpu" )
321   MDRV_CPU_PROGRAM_MAP( vc20i_mem)
321   MDRV_CPU_PROGRAM_MAP(vc20i_mem)
322322MACHINE_DRIVER_END
323323
324324
r4790r4791
326326   MDRV_IMPORT_FROM( vic20 )
327327
328328   MDRV_CPU_REPLACE( "maincpu", M6502, VIC6561_CLOCK )
329   MDRV_CPU_PROGRAM_MAP( vc20i_mem)
329   MDRV_CPU_PROGRAM_MAP(vc20i_mem)
330330
331331   MDRV_SCREEN_MODIFY("screen")
332332   MDRV_SCREEN_REFRESH_RATE(VIC6561_VRETRACERATE)
r4790r4791
354354
355355
356356ROM_START( vic1001 )
357   ROM_REGION (0x10000, "maincpu", 0 )
357   ROM_REGION( 0x10000, "maincpu", 0 )
358358   ROM_FILL( 0x0000, 0x8000, 0xff )
359359   ROM_LOAD( "901460.02", 0x8000, 0x1000, CRC(fcfd8a4b) SHA1(dae61ac03065aa2904af5c123ce821855898c555) )
360360   ROM_FILL( 0x9000, 0x3000, 0xff )
r4790r4791
364364
365365
366366ROM_START( vic20 )
367   ROM_REGION (0x10000, "maincpu", 0 )
367   ROM_REGION( 0x10000, "maincpu", 0 )
368368   ROM_FILL( 0x0000, 0x8000, 0xff )
369369   ROM_LOAD( "901460.03", 0x8000, 0x1000, CRC(83e032a6) SHA1(4fd85ab6647ee2ac7ba40f729323f2472d35b9b4) )
370370   ROM_FILL( 0x9000, 0x3000, 0xff )
r4790r4791
373373ROM_END
374374
375375ROM_START( vic20pal )
376   ROM_REGION (0x10000, "maincpu", 0 )
376   ROM_REGION( 0x10000, "maincpu", 0 )
377377   ROM_FILL( 0x0000, 0x8000, 0xff )
378378   ROM_LOAD( "901460.03", 0x8000, 0x1000, CRC(83e032a6) SHA1(4fd85ab6647ee2ac7ba40f729323f2472d35b9b4) )
379379   ROM_FILL( 0x9000, 0x3000, 0xff )
r4790r4791
389389ROM_START( vic20swe )
390390   /* patched pal system for swedish/finish keyboard and chars */
391391   /* but in rom? (maybe patched means in this case nec version) */
392   ROM_REGION (0x10000, "maincpu", 0 )
392   ROM_REGION( 0x10000, "maincpu", 0 )
393393   ROM_FILL( 0x0000, 0x8000, 0xff )
394394   ROM_LOAD( "nec22101.207", 0x8000, 0x1000, CRC(d808551d) SHA1(f403f0b0ce5922bd61bbd768bdd6f0b38e648c9f) )
395395   ROM_FILL( 0x9000, 0x3000, 0xff )
r4790r4791
399399
400400
401401ROM_START( vic20i )
402   ROM_REGION (0x10000, "maincpu", 0 )
402   ROM_REGION( 0x10000, "maincpu", 0 )
403403   ROM_FILL( 0x0000, 0x8000, 0xff )
404404   ROM_LOAD( "901460.03", 0x8000, 0x1000, CRC(83e032a6) SHA1(4fd85ab6647ee2ac7ba40f729323f2472d35b9b4) )
405405   ROM_FILL( 0x9000, 0x2000, 0xff )
r4790r4791
407407   ROM_LOAD( "901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d) )
408408   ROM_LOAD( "901486.06", 0xe000, 0x2000, CRC(e5e7c174) SHA1(06de7ec017a5e78bd6746d89c2ecebb646efeb19) )
409409
410/*   C2031_ROM ("cpu_vc1540") */
410   C2031_ROM("cpu_vc1540")   // this is not currently emulated, but we document here the firmware
411411ROM_END
412412
413413ROM_START( vic20v )
414   ROM_REGION (0x10000, "maincpu", 0 )
414   ROM_REGION( 0x10000, "maincpu", 0 )
415415   ROM_FILL( 0x0000, 0x8000, 0xff )
416416   ROM_LOAD( "901460.03", 0x8000, 0x1000, CRC(83e032a6) SHA1(4fd85ab6647ee2ac7ba40f729323f2472d35b9b4) )
417417   ROM_FILL( 0x9000, 0x3000, 0xff )
418418   ROM_LOAD( "901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d) )
419419   ROM_LOAD( "901486.06", 0xe000, 0x2000, CRC(e5e7c174) SHA1(06de7ec017a5e78bd6746d89c2ecebb646efeb19) )
420420
421   VC1540_ROM ("cpu_vc1540")
421   VC1540_ROM("cpu_vc1540")
422422ROM_END
423423
424424ROM_START( vic20plv )
425   ROM_REGION (0x10000, "maincpu", 0 )
425   ROM_REGION( 0x10000, "maincpu", 0 )
426426   ROM_FILL( 0x0000, 0x8000, 0xff )
427427   ROM_LOAD( "901460.03", 0x8000, 0x1000, CRC(83e032a6) SHA1(4fd85ab6647ee2ac7ba40f729323f2472d35b9b4) )
428428   ROM_FILL( 0x9000, 0x3000, 0xff )
429429   ROM_LOAD( "901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d) )
430430   ROM_LOAD( "901486.07", 0xe000, 0x2000, CRC(4be07cb4) SHA1(ce0137ed69f003a299f43538fa9eee27898e621e) )
431431
432   VC1541_ROM("cpu_vc1540")
432   VC1540_ROM("cpu_vc1540")
433433ROM_END
434434
435435#define rom_vc20v      rom_vic20plv
r4790r4791
478478
479479COMP( 1981, vic20pal,  vic20,  0,   vc20,   vc20,     vc20,   vic20,     "Commodore Business Machines Co.",  "VC 20 (PAL)", GAME_IMPERFECT_SOUND)
480480COMP( 1981, vic20crp,  vic20,  0,   vc20,   vc20,     vc20,   vic20,     "Commodore Business Machines Co.",  "VC 20CR (PAL)", GAME_IMPERFECT_SOUND)
481COMP( 1981, vic20plv,  vic20,  0,   vc20v,  vic20,    vc20v,  vic20v,    "Commodore Business Machines Co.",  "VC 20 (PAL, VC1541)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
481COMP( 1981, vic20plv,  vic20,  0,   vc20v,  vic20,    vc20v,  vic20v,    "Commodore Business Machines Co.",  "VC 20 (PAL, VC1540)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
482482COMP( 1981, vc20,      vic20,  0,   vc20,   vc20,     vc20,   vic20,     "Commodore Business Machines Co.",  "VIC 20 (PAL, Germany)", GAME_IMPERFECT_SOUND)
483COMP( 1981, vc20v,     vic20,  0,   vc20v,  vic20,    vc20v,  vic20v,    "Commodore Business Machines Co.",  "VIC 20 (PAL, Germany, VC1541)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
483COMP( 1981, vc20v,     vic20,  0,   vc20v,  vic20,    vc20v,  vic20v,    "Commodore Business Machines Co.",  "VIC 20 (PAL, Germany, VC1540)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
484484
485485COMP( 1981, vic20swe,  vic20,  0,   vc20,   vic20swe, vc20,   vic20,     "Commodore Business Machines Co.",  "VIC 20 (PAL, Swedish Expansion Kit)", GAME_IMPERFECT_SOUND)
src/mess/drivers/c64.c
r4790r4791
676676
677677   ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 )
678678
679   VC1541_ROM( "cpu_vc1540" )
679   VC1541_ROM("cpu_vc1540")
680680ROM_END
681681
682682ROM_START( dx64 )
683683   ROM_REGION( 0x19400, "maincpu", 0 )
684684    ROM_LOAD( "901226-01.bin", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) )
685    ROM_LOAD( "dx64kern.bin",     0x12000, 0x2000, CRC(58065128) )
685    ROM_LOAD( "dx64kern.bin",  0x12000, 0x2000, CRC(58065128) )
686686
687687   ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 )
688688
689    // vc1541 roms were not included in submission
690    VC1541_ROM ("cpu_vc1540")
691//   VC1541_ROM (" ")
689    // correct vc1541 roms were not included in submission
690    VC1541_ROM("cpu_vc1540")
692691ROM_END
693692
694693ROM_START( vip64 )
r4790r4791
699698
700699   ROM_REGION( 0x80000, "cart", ROMREGION_ERASE00 )
701700
702   VC1541_ROM( "cpu_vc1540" )
701   VC1541_ROM("cpu_vc1540")
703702ROM_END
704703
705704
docs/messnew.txt
r4790r4791
55- Amiga 1200 NTSC & PAL (not working)  [incog nito, Dirk Best, Fabio Priuli]
66- Amiga CD32 (not working)  [incog nito, Fabio Priuli]
77- Amstrad NC150  [Roberto Carlos Fernandez Gerhardt, Wilbert Pol]
8- Brailab 4 (not working) [Miodrag Milanovic]
89- CD-I (not working)  [incog nito]
910- CIP-01 [Miodrag Milanovic]
1011- Frael Bruc 100-1 [Miodrag Milanovic]
r4790r4791
1213- MC80.30/31 (not working) [Miodrag Milanovic]
1314- Microbee Premium PC85 (not working) [Robbbert]
1415- Microbee 64k (not working) [Robbbert]
16- Microprofessor III [Miodrag Milanovic]
1517- NTS DreamWriter T200 (not working)  [Roberto Carlos
1618  Fernandez Gerhardt, Wilbert Pol]
1719- PolyMorphic Systems Poly-88 [Miodrag Milanovic]
20- Pravetz 82, 8M and 8C [Miodrag Milanovic]
1821- Ringo 470 (not working) [Miodrag Milanovic]
1922- Samsung SPC-1000 [Miodrag Milanovic]
23- Sharp Pocket Computer 1245,1250,1255,1260,1261/1262 [Miodrag Milanovic]
2024- TK85 [Robbbert, Miodrag Milanovic]
2125- Timex Sinclair 1500 [Robbbert, Miodrag Milanovic]
22- Pravetz 82, 8M and 8C [Miodrag Milanovic]
23- Microprofessor III [Miodrag Milanovic]
24- Brailab 4 (not working) [Miodrag Milanovic]
25- Sharp Pocket Computer 1245,1250,1255,1260,1261/1262 [Miodrag Milanovic]
2626
2727Skeleton drivers :
2828------------------
r4790r4791
5656- Hector 2HRX
5757- Hector 1
5858- Jaguar CD
59- Nanos
5960- NEC PC-6001
6061- NEC PC-6001A
6162- NEC PC-6001mkII
r4790r4791
7172- Plydin-601
7273- Plydin-601A
7374- Poly-Computer 880
75- Robotron A5120
76- Robotron A5130
7477- Schachcomputer SC1
7578- Schachcomputer SC2
7679- Sega 32X
r4790r4791
8790- Visual 1050
8891- Xerox 820
8992- XOR-100-12
90- Nanos
91- Robotron A5120
92- Robotron A5130
9393
9494System Driver Changes:
9595----------------------
r4790r4791
9797  few are still marked as BAD_DUMP while waiting for confirmation. [Freddy
9898  Offenga, Fabio Priuli]
9999
100- [C128] Added verified Swedish / Finnish dump [Iggy Drougge, Fabio Priuli]
101
102- [CBM] Added floppy drive firmwares and enabled floppy emulation code
103  (with some fix) in sx64, c16c, c16v, vic20v, c128d, c128dcr, c128d81.
104  The code is still not working, but it can be enabled since it does
105  not crash MESS anymore. [Fabio Priuli]
106
100107- [COLECO] Fixed controller bug introduced in 0.131. [Fabio Priuli]
101108
102109- [CRVISION] Added support for stereo tapes. [Curt Coder]

Previous 15994 Revisions Next


© 1998-2018 The MESS Team