Previous 15994 Revisions Next

r3190 Saturday 6th September, 2008 at 21:22:32 UTC by Fabio Priuli
[C64/C128/VIC20] Added tape recording to the Datasette emulation
[COMMODORE] Cleaned up comments and documentation in c16.c, c128.c, c64.c, c65.c and vc20.c. Also, reorganized sets, added clones and alt BIOSes. Finally removed outdated vc20tape.c/.h
[docs]messnew.txt
[src/mess]messdriv.c
[src/mess/drivers]c128.c c16.c c64.c c65.c vc20.c
[src/mess/includes]vc20tape.h
[src/mess/machine]c128.c c64.c c65.c vc20.c vc20tape.c

src/mess/includes/vc20tape.h
r3189r3190
1/*****************************************************************************
2 *
3 * includes/vc20tape.h
4 *
5 ****************************************************************************/
6
7#ifndef VC20TAPE_H_
8#define VC20TAPE_H_
9
10
11/*----------- defined in machine/vc20tape.c -----------*/
12
13/* put this into your gamedriver */
14void vc20tape_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
15
16/* the function which should be called by change on readline */
17extern void vc20_tape_open (write8_machine_func read_callback);
18extern void c16_tape_open (void);
19extern void vc20_tape_close (void);
20
21/* must be high active keys */
22/* set it frequently */
23extern void vc20_tape_buttons (int play, int record, int stop);
24extern void vc20_tape_config (int on, int noise);
25
26extern int vc20_tape_read (void);
27extern void vc20_tape_write (int data);
28extern void vc20_tape_motor (int data);
29
30/* pressed wenn cassette is in */
31extern int vc20_tape_switch (void);
32
33/* delivers status for displaying */
34extern void vc20_tape_status (char *text, int size);
35
36
37#endif /* VC20TAPE_H_ */
src/mess/messdriv.c
r3189r3190
311311   DRIVER( superpet )   /* Commodore SP9000/MMF9000 (50Hz)               */
312312   DRIVER( mmf9000 )   /* Commodore MMF9000 Swedish                  */
313313
314   DRIVER( vic20 )      /* Commodore Vic-20 NTSC                     */
315   DRIVER( vic1001 )   /* Commodore VIC-1001 (VIC20 Japan)               */
316   DRIVER( vc20 )      /* Commodore Vic-20 PAL                        */
317   DRIVER( vic20swe )   /* Commodore Vic-20 Sweden                     */
318   DRIVER( vic20v )   /* Commodore Vic-20 NTSC, VC1540               */
319   DRIVER( vc20v )      /* Commodore Vic-20 PAL, VC1541                  */
320   DRIVER( vic20i )   /* Commodore Vic-20 IEEE488 Interface            */
314   DRIVER( vic1001 )   /* Commodore VIC-1001 (Japan)                  */
315   DRIVER( vic20 )      /* Commodore VIC 20 (NTSC)                     */
316   DRIVER( vic20cr )   /* Commodore VIC 20CR (NTSC)                  */
317   DRIVER( vic20i )   /* Commodore VIC 20 (NTSC, IEEE488 Interface)      */
318   DRIVER( vic20v )   /* Commodore VIC 20 (NTSC, VC1540)               */
319   DRIVER( vic20pal )   /* Commodore VIC 20 (PAL)                     */
320   DRIVER( vic20crp )   /* Commodore VIC 20CR (PAL)                     */
321   DRIVER( vic20plv )   /* Commodore VIC 20 (PAL, VC1541)               */
322   DRIVER( vc20 )      /* Commodore VIC 20 (PAL, Germany)               */
323   DRIVER( vc20v )      /* Commodore VIC 20 (PAL, VC1541)               */
324   DRIVER( vic20swe )   /* Commodore VIC 20 (Swedish Expanson Kit)         */
321325
322   DRIVER( max )      /* Max (Japan)/Ultimax (US)/VC10 (German)         */
323   DRIVER( c64 )      /* Commodore 64 - NTSC                        */
324   DRIVER( c64pal )   /* Commodore 64 - PAL                        */
325   DRIVER( vic64s )   /* Commodore VIC64S (Swedish)                  */
326   DRIVER( cbm4064 )   /* Commodore CBM4064                        */
327   DRIVER( sx64 )      /* Commodore SX 64 - PAL                     */
326   DRIVER( max )      /* Commodore Max Machine (Japan)               */
327   DRIVER( c64 )      /* Commodore 64 (NTSC)                        */
328   DRIVER( c64pal )   /* Commodore 64 (PAL)                        */
329   DRIVER( c64jpn )   /* Commodore 64 (Japan)                        */
330   DRIVER( c64swe )   /* Commodore 64 (Sweden)                     */
331   DRIVER( vic64s )   /* Commodore VIC 64S (Sweden)                  */
332   DRIVER( pet64 )      /* Commodore PET 64                           */
333   DRIVER( cbm4064 )   /* Commodore CBM 4064                        */
334   DRIVER( edu64 )      /* Commodore Educator 64                     */
335   DRIVER( sx64 )      /* Commodore SX-64 Executive Machine (PAL)         */
328336   DRIVER( vip64 )      /* Commodore VIP64 (SX64, PAL, Swedish)            */
329//   DRIVER( dx64 )      /* Commodore DX 64 - PROTOTPYE, PAL               */
337//   DRIVER( dx64 )      /* Commodore DX-64 - Prototype                  */
338   DRIVER( c64c )      /* Commodore 64C (NTSC)                        */
339   DRIVER( c64cpal )   /* Commodore 64C (PAL)                        */
340   DRIVER( c64g )      /* Commodore 64G (PAL)                        */
330341   DRIVER( c64gs )      /* Commodore 64 Games System                  */
331342
332343   DRIVER( cbm500 )   /* Commodore 500/P128-40                     */
r3189r3190
338349   DRIVER( cbm720se )   /* Commodore 720/B256HP Swedish/Finnish            */
339350
340351   DRIVER( c16 )      /* Commodore 16                              */
341   DRIVER( c16hun )   /* Commodore 16 Novotrade (Hungarian Character Set)   */
342352   DRIVER( c16c )      /* Commodore 16  c1551                        */
343353   DRIVER( c16v )      /* Commodore 16  vc1541                        */
344   DRIVER( plus4 )      /* Commodore +4  c1551                        */
345   DRIVER( plus4c )   /* Commodore +4  vc1541                        */
346   DRIVER( plus4v )   /* Commodore +4                              */
354   DRIVER( c16hun )   /* Commodore 16 Novotrade (Hungarian Character Set)   */
355   DRIVER( c116 )      /* Commodore 116                           */
356   DRIVER( c116c )      /* Commodore 116  c1551                        */
357   DRIVER( c116v )      /* Commodore 116  vc1541                     */
358   DRIVER( plus4 )      /* Commodore +4                              */
359   DRIVER( plus4c )   /* Commodore +4  c1551                        */
360   DRIVER( plus4v )   /* Commodore +4  vc1541                        */
347361   DRIVER( c232 )      /* Commodore 232 - Prototype                  */
348   DRIVER( c364 )      /* Commodore 364 - Prototype                  */
362   DRIVER( c264 )      /* Commodore 264 - Prototype                  */
363   DRIVER( c364 )      /* Commodore V364 - Prototype                  */
349364
350365   DRIVER( c128 )      /* Commodore 128 - NTSC                        */
351   DRIVER( c128ger )   /* Commodore 128 - PAL (german)                  */
352   DRIVER( c128fra )   /* Commodore 128 - PAL (french)                  */
353   DRIVER( c128ita )   /* Commodore 128 - PAL (italian)               */
354   DRIVER( c128swe )   /* Commodore 128 - PAL (swedish)               */
355   DRIVER( c128nor )   /* Commodore 128 - PAL (norwegian)               */
356   DRIVER( c128d )      /* Commodore 128D - NTSC                     */
357//   DRIVER( c128dita )   /* Commodore 128D - PAL (italian) cost reduced set   */
366   DRIVER( c128cr )   /* Commodore 128CR - NTSC (proto?)               */
367   DRIVER( c128fin )   /* Commodore 128 - PAL (Finnish)               */
368   DRIVER( c128fra )   /* Commodore 128 - PAL (French)                  */
369   DRIVER( c128ger )   /* Commodore 128 - PAL (German)                  */
370   DRIVER( c128nor )   /* Commodore 128 - PAL (Norwegian)               */
371   DRIVER( c128d )      /* Commodore 128D - PAL                        */
372   DRIVER( c128dpr )   /* Commodore 128D - NTSC (proto)               */
373   DRIVER( c128dcr )   /* Commodore 128DCR - NTSC                     */
374   DRIVER( c128drde )   /* Commodore 128DCR - PAL (German)               */
375   DRIVER( c128drit )   /* Commodore 128DCR - PAL (Italian)               */
376   DRIVER( c128drsw )   /* Commodore 128DCR - PAL (Swedish)               */
358377
359378   DRIVER( a500n )      /* Commodore Amiga 500 - NTSC                  */
360379   DRIVER( a500p )      /* Commodore Amiga 500 - PAL                  */
src/mess/machine/vc20tape.c
r3189r3190
1/***************************************************************************
2
3  cbm vc20/c64
4  cbm c16 series (other physical representation)
5  tape/cassette/datassette emulation
6
7***************************************************************************/
8#include <ctype.h>
9#include <stdio.h>
10
11#include "driver.h"
12#include "image.h"
13#include "sound/dac.h"
14
15#include "includes/vc20tape.h"
16
17#define TONE_ON_VALUE 0xff
18
19/* write line high active, */
20/* read line low active!? */
21
22#define TAPE_WAV 1
23#define TAPE_PRG 2
24
25static struct
26{
27   int on, noise;
28   int play, record;
29
30   int data;
31   int motor;
32   write8_machine_func read_callback;
33
34   int type;                     /* 0 nothing */
35}
36tape;
37
38/* these are the values for wav files */
39static struct
40{
41   int state;
42   emu_timer *timer;
43   int pos;
44   struct GameSample *sample;
45   const device_config *img;
46} wav;
47
48/* these are the values for prg files */
49static struct
50{
51   int state;
52   emu_timer *prg_timer;
53   emu_timer *timer;
54   int pos;
55
56#define VC20_SHORT      (176e-6)
57#define VC20_MIDDLE      (256e-6)
58#define VC20_LONG      (336e-6)
59#define C16_SHORT   (246e-6)         /* messured */
60#define C16_MIDDLE   (483e-6)
61#define C16_LONG   (965e-6)
62#define PCM_SHORT   (double_to_attotime(prg.c16?C16_SHORT:VC20_SHORT))
63#define PCM_MIDDLE   (double_to_attotime(prg.c16?C16_MIDDLE:VC20_MIDDLE))
64#define PCM_LONG   (double_to_attotime(prg.c16?C16_LONG:VC20_LONG))
65   int c16;
66   UINT8 *prg;
67   int length;
68   int stateblock, stateheader, statebyte, statebit;
69   int prgdata;
70   char name[16];                  /*name for cbm */
71   UINT8 chksum;
72   attotime lasttime;
73   const device_config *img;
74} prg;
75
76/* from sound/samples.c no changes (static declared) */
77/* readsamples not useable (loads files only from sample or game directory) */
78/* and doesn't search the rompath */
79static struct GameSample *vc20_read_wav_sample (const device_config *image)
80{
81   /* NPW 28-Feb-2005 - this code sucks */
82   return NULL;
83#if 0
84   unsigned long offset = 0;
85   UINT32 length, rate, filesize, temp32;
86   UINT16 bits, temp16;
87   char buf[32];
88   struct GameSample *result;
89   int i;
90
91   /* read the core header and make sure it's a WAVE file */
92   offset += mame_fread (f, buf, 4);
93   if (offset < 4)
94      return NULL;
95   if (memcmp (&buf[0], "RIFF", 4) != 0)
96      return NULL;
97
98   /* get the total size */
99   offset += mame_fread (f, &filesize, 4);
100   if (offset < 8)
101      return NULL;
102   filesize = LITTLE_ENDIANIZE_INT32 (filesize);
103
104   /* read the RIFF file type and make sure it's a WAVE file */
105   offset += mame_fread (f, buf, 4);
106   if (offset < 12)
107      return NULL;
108   if (memcmp (&buf[0], "WAVE", 4) != 0)
109      return NULL;
110
111   /* seek until we find a format tag */
112   while (1)
113   {
114      offset += mame_fread (f, buf, 4);
115      offset += mame_fread (f, &length, 4);
116      length = LITTLE_ENDIANIZE_INT32 (length);
117      if (memcmp (&buf[0], "fmt ", 4) == 0)
118         break;
119
120      /* seek to the next block */
121      mame_fseek (f, length, SEEK_CUR);
122      offset += length;
123      if (offset >= filesize)
124         return NULL;
125   }
126
127   /* read the format -- make sure it is PCM */
128   offset += mame_fread(f, &temp16, 2);
129   temp16 = LITTLE_ENDIANIZE_INT16(temp16);
130   if (temp16 != 1)
131      return NULL;
132
133   /* number of channels -- only mono is supported */
134   offset += mame_fread(f, &temp16, 2);
135   temp16 = LITTLE_ENDIANIZE_INT16(temp16);
136   if (temp16 != 1)
137      return NULL;
138
139   /* sample rate */
140   offset += mame_fread (f, &rate, 4);
141   rate = LITTLE_ENDIANIZE_INT32 (rate);
142
143   /* bytes/second and block alignment are ignored */
144   offset += mame_fread (f, buf, 6);
145
146   /* bits/sample */
147   offset += mame_fread(f, &bits, 2);
148   bits = LITTLE_ENDIANIZE_INT16(bits);
149   if (bits != 8 && bits != 16)
150      return NULL;
151
152   /* seek past any extra data */
153   mame_fseek (f, length - 16, SEEK_CUR);
154   offset += length - 16;
155
156   /* seek until we find a data tag */
157   while (1)
158   {
159      offset += mame_fread (f, buf, 4);
160      offset += mame_fread (f, &length, 4);
161      length = LITTLE_ENDIANIZE_INT32 (length);
162      if (memcmp (&buf[0], "data", 4) == 0)
163         break;
164
165      /* seek to the next block */
166      mame_fseek (f, length, SEEK_CUR);
167      offset += length;
168      if (offset >= filesize)
169         return NULL;
170   }
171
172   /* allocate the game sample */
173   result = (struct GameSample *)malloc (sizeof (struct GameSample) + length);
174
175   if (result == NULL)
176      return NULL;
177
178   /* fill in the sample data */
179   result->length = length;
180   result->smpfreq = rate;
181   result->resolution = bits;
182
183   /* read the data in */
184   if (bits == 8)
185   {
186      mame_fread (f, result->data, length);
187
188      /* convert 8-bit data to signed samples */
189      for (temp32 = 0; temp32 < length; temp32++)
190         result->data[temp32] -= 0x80;
191   }
192   else
193   {
194      /* 16-bit data is fine as-is */
195      mame_fread(f, result->data, length);
196      for (i = 0; i < length; i += 2)
197      {
198         UINT16 *ptr = (UINT16 *) (&result->data[i]);
199         *ptr = LITTLE_ENDIANIZE_INT16(ptr);
200      }
201   }
202   return result;
203#endif
204}
205
206static TIMER_CALLBACK(vc20_wav_timer);
207static void vc20_wav_state (void)
208{
209   /* NPW 28-Feb-2005 - this code sucks */
210#if 0
211   switch (wav.state)
212   {
213   case 0:
214      break;                     /* not inited */
215   case 1:                     /* off */
216      if (tape.on)
217      {
218         wav.state = 2;
219         break;
220      }
221      break;
222   case 2:                     /* on */
223      if (!tape.on)
224      {
225         wav.state = 1;
226         tape.play = 0;
227         tape.record = 0;
228         dac_data_w (0, 0);
229         break;
230      }
231      if (tape.motor && tape.play)
232      {
233         wav.state = 3;
234         timer_adjust_periodic(wav.timer, 0, 0, 1.0 / wav.sample->smpfreq);
235         break;
236      }
237      if (tape.motor && tape.record)
238      {
239         wav.state = 4;
240         break;
241      }
242      break;
243   case 3:                     /* reading */
244      if (!tape.on)
245      {
246         wav.state = 1;
247         tape.play = 0;
248         tape.record = 0;
249         dac_data_w (0, 0);
250         timer_reset(wav.timer, attotime_never);
251         break;
252      }
253      if (!tape.motor || !tape.play)
254      {
255         wav.state = 2;
256         timer_reset(wav.timer, attotime_never);
257         dac_data_w (0, 0);
258         break;
259      }
260      break;
261   case 4:                     /* saving */
262      if (!tape.on)
263      {
264         wav.state = 1;
265         tape.play = 0;
266         tape.record = 0;
267         dac_data_w (0, 0);
268         break;
269      }
270      if (!tape.motor || !tape.record)
271      {
272         wav.state = 2;
273         dac_data_w (0, 0);
274         break;
275      }
276      break;
277   }
278#endif
279}
280
281static void vc20_wav_open(const device_config *image)
282{
283   if ((wav.sample = vc20_read_wav_sample (image)) == NULL)
284   {
285      logerror("tape %s could not be loaded\n", image_filename(image));
286      return;
287   }
288   logerror("tape %s loaded\n", image_filename(image));
289
290   tape.type = TAPE_WAV;
291   wav.img = image;
292   wav.pos = 0;
293   tape.on = 1;
294   wav.state = 2;
295}
296
297static void vc20_wav_write (int data)
298{
299   if (tape.noise)
300      dac_data_w (0, data);
301}
302
303static TIMER_CALLBACK(vc20_wav_timer)
304{
305   /* NPW 28-Feb-2005 - this code sucks */
306#if 0
307   if (wav.sample->resolution == 8)
308   {
309      tape.data = wav.sample->data[wav.pos] > 0x0;
310      wav.pos++;
311      if (wav.pos >= wav.sample->length)
312      {
313         wav.pos = 0;
314         tape.play = 0;
315      }
316   }
317   else
318   {
319      tape.data = ((short *) (wav.sample->data))[wav.pos] > 0x0;
320      wav.pos++;
321      if (wav.pos * 2 >= wav.sample->length)
322      {
323         wav.pos = 0;
324         tape.play = 0;
325      }
326   }
327   if (tape.noise)
328      dac_data_w (0, tape.data ? TONE_ON_VALUE : 0);
329   if (tape.read_callback)
330      tape.read_callback (0, tape.data);
331   /*    vc20_wav_state(); // removing timer in timer puls itself hangs */
332#endif
333}
334
335static TIMER_CALLBACK(vc20_prg_timer);
336static void vc20_prg_state (void)
337{
338   switch (prg.state)
339   {
340   case 0:
341      break;                     /* not inited */
342   case 1:                     /* off */
343      if (tape.on)
344      {
345         prg.state = 2;
346         break;
347      }
348      break;
349   case 2:                     /* on */
350      if (!tape.on)
351      {
352         prg.state = 1;
353         tape.play = 0;
354         tape.record = 0;
355         dac_data_w (0, 0);
356         break;
357      }
358      if (tape.motor && tape.play)
359      {
360         prg.state = 3;
361         timer_reset(prg.timer, attotime_zero);
362         break;
363      }
364      if (tape.motor && tape.record)
365      {
366         prg.state = 4;
367         break;
368      }
369      break;
370   case 3:                     /* reading */
371      if (!tape.on)
372      {
373         prg.state = 1;
374         tape.play = 0;
375         tape.record = 0;
376         dac_data_w (0, 0);
377         timer_reset(prg.timer, attotime_never);
378         break;
379      }
380      if (!tape.motor || !tape.play)
381      {
382         prg.state = 2;
383         timer_reset(prg.timer, attotime_never);
384         dac_data_w (0, 0);
385         break;
386      }
387      break;
388   case 4:                     /* saving */
389      if (!tape.on)
390      {
391         prg.state = 1;
392         tape.play = 0;
393         tape.record = 0;
394         dac_data_w (0, 0);
395         break;
396      }
397      if (!tape.motor || !tape.record)
398      {
399         prg.state = 2;
400         dac_data_w (0, 0);
401         break;
402      }
403      break;
404   }
405}
406
407static void vc20_prg_open(const device_config *image)
408{
409   const char *name;
410   int i;
411
412   prg.length = image_length(image);
413   prg.prg = image_ptr(image);
414   if (!prg.prg)
415   {
416      logerror("tape %s could not be loaded\n", image_filename(image));
417      return;
418   }
419   logerror("tape %s loaded\n", image_filename(image));
420
421   name = image_filename(image);
422    for (i = 0; name[i] != 0; i++)
423      prg.name[i] = toupper (name[i]);
424   for (; i < 16; i++)
425      prg.name[i] = ' ';
426
427   prg.img = image;
428   prg.stateblock = 0;
429   prg.stateheader = 0;
430   prg.statebyte = 0;
431   prg.statebit = 0;
432   tape.type = TAPE_PRG;
433   tape.on = 1;
434   prg.state = 2;
435   prg.pos = 0;
436   prg.timer = prg.prg_timer;
437}
438
439static void vc20_prg_write (int data)
440{
441#if 0
442   /* this was used to decode cbms tape format, but could */
443   /* be converted to a real program writer */
444   /* c16: be sure the cpu clock is about 1.8 MHz (when screen is off) */
445   static int count = 0;
446   static int old = 0;
447   static double time = 0;
448   static int bytecount = 0, byte;
449
450   if (old != data)
451   {
452      double neu = timer_get_time ();
453      int diff = (neu - time) * 1000000;
454
455      count++;
456      logerror("%f %d %s %d\n", (PCM_LONG + PCM_MIDDLE) / 2,
457                bytecount, old ? "high" : "low",
458                diff);
459      if (old)
460      {
461         if (count > 0 /*27000 */ )
462         {
463            switch (bytecount)
464            {
465            case 0:
466               if (diff > (PCM_LONG + PCM_MIDDLE) * 1e6 / 2)
467               {
468                  bytecount++;
469                  byte = 0;
470               }
471               break;
472            case 1:
473            case 3:
474            case 5:
475            case 7:
476            case 9:
477            case 11:
478            case 13:
479            case 15:
480            case 17:
481               bytecount++;
482               break;
483            case 2:
484               if (diff > (PCM_MIDDLE + PCM_SHORT) * 1e6 / 2)
485                  byte |= 1;
486               bytecount++;
487               break;
488            case 4:
489               if (diff > (PCM_MIDDLE + PCM_SHORT) * 1e6 / 2)
490                  byte |= 2;
491               bytecount++;
492               break;
493            case 6:
494               if (diff > (PCM_MIDDLE + PCM_SHORT) * 1e6 / 2)
495                  byte |= 4;
496               bytecount++;
497               break;
498            case 8:
499               if (diff > (PCM_MIDDLE + PCM_SHORT) * 1e6 / 2)
500                  byte |= 8;
501               bytecount++;
502               break;
503            case 10:
504               if (diff > (PCM_MIDDLE + PCM_SHORT) * 1e6 / 2)
505                  byte |= 0x10;
506               bytecount++;
507               break;
508            case 12:
509               if (diff > (PCM_MIDDLE + PCM_SHORT) * 1e6 / 2)
510                  byte |= 0x20;
511               bytecount++;
512               break;
513            case 14:
514               if (diff > (PCM_MIDDLE + PCM_SHORT) * 1e6 / 2)
515                  byte |= 0x40;
516               bytecount++;
517               break;
518            case 16:
519               if (diff > (PCM_MIDDLE + PCM_SHORT) * 1e6 / 2)
520                  byte |= 0x80;
521               logerror("byte %.2x\n", byte);
522               bytecount = 0;
523               break;
524            }
525         }
526      }
527      old = data;
528      time = timer_get_time ();
529   }
530#endif
531   if (tape.noise)
532      dac_data_w (0, data ? TONE_ON_VALUE : 0);
533}
534
535static void vc20_tape_bit (int bit)
536{
537   switch (prg.statebit)
538   {
539   case 0:
540      if (bit)
541      {
542         timer_reset (prg.timer, prg.lasttime = PCM_MIDDLE);
543         prg.statebit = 2;
544      }
545      else
546      {
547         prg.statebit++;
548         timer_reset (prg.timer, prg.lasttime = PCM_SHORT);
549      }
550      break;
551   case 1:
552      timer_reset (prg.timer, prg.lasttime = PCM_MIDDLE);
553      prg.statebit = 0;
554      break;
555   case 2:
556      timer_reset (prg.timer, prg.lasttime = PCM_SHORT);
557      prg.statebit = 0;
558      break;
559   }
560}
561
562static void vc20_tape_byte (void)
563{
564   static int bit = 0, parity = 0;
565
566   /* convert one byte to vc20 tape data
567    * puls wide modulation
568    * 3 type of pulses (quadratic on/off pulse)
569    * K (short) 176 microseconds
570    * M 256
571    * L 336
572    * LM bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 oddparity
573    * 0 coded as KM, 1 as MK
574    * gives 8.96 milliseconds for 1 byte
575    */
576   switch (prg.statebyte)
577   {
578   case 0:
579      timer_reset (prg.timer, prg.lasttime = PCM_LONG);
580      prg.statebyte++;
581      break;
582   case 1:
583      timer_reset (prg.timer, prg.lasttime = PCM_MIDDLE);
584      prg.statebyte++;
585      bit = 1;
586      parity = 0;
587      break;
588   case 2:
589   case 3:
590   case 4:
591   case 5:
592   case 6:
593   case 7:
594   case 8:
595   case 9:
596      vc20_tape_bit (prg.prgdata & bit);
597      if (prg.prgdata & bit)
598         parity = !parity;
599      bit <<= 1;
600      prg.statebyte++;
601      break;
602   case 10:
603      vc20_tape_bit (!parity);
604      prg.chksum ^= prg.prgdata;
605      prg.statebyte = 0;
606      prg.pos--;
607      break;
608   }
609}
610
611/* 01 prg id
612 * lo hi load address
613 * lo hi end address
614 * 192-5-1 bytes: filename (filled with 0x20)
615 * xor chksum */
616static void vc20_tape_prgheader (void)
617{
618   static int i = 0;
619
620   switch (prg.stateheader)
621   {
622   case 0:
623      prg.chksum = 0;
624      prg.prgdata = 1;
625      prg.stateheader++;
626      vc20_tape_byte ();
627      break;
628   case 1:
629      prg.prgdata = prg.prg[0];
630      prg.stateheader++;
631      vc20_tape_byte ();
632      break;
633   case 2:
634      prg.prgdata = prg.prg[1];
635      prg.stateheader++;
636      vc20_tape_byte ();
637      break;
638   case 3:
639      prg.prgdata = (prg.prg[0] + prg.length - 2) & 0xff;
640      prg.stateheader++;
641      vc20_tape_byte ();
642      break;
643   case 4:
644      prg.prgdata = ((prg.prg[0] + (prg.prg[1] << 8)) + prg.length - 2) >> 8;
645      prg.stateheader++;
646      i = 0;
647      vc20_tape_byte ();
648      break;
649   case 5:
650      if ((i != 16) && (prg.name[i] != 0))
651      {
652         prg.prgdata = prg.name[i];
653         i++;
654         vc20_tape_byte ();
655         break;
656      }
657      prg.prgdata = 0x20;
658      prg.stateheader++;
659      vc20_tape_byte ();
660      break;
661   case 6:
662      if (i != 192 - 5 - 1)
663      {
664         vc20_tape_byte ();
665         i++;
666         break;
667      }
668      prg.prgdata = prg.chksum;
669      vc20_tape_byte ();
670      prg.stateheader = 0;
671      break;
672   }
673}
674
675static void vc20_tape_program (void)
676{
677   static int i = 0;
678
679   switch (prg.stateblock)
680   {
681   case 0:
682      prg.pos = (9 + 192 + 1) * 2 + (9 + prg.length - 2 + 1) * 2;
683      i = 0;
684      prg.stateblock++;
685      timer_reset (prg.timer, prg.lasttime = PCM_SHORT);
686      break;
687   case 1:
688      i++;
689      if (i < 12000 /*27136 */ )
690      {                        /* this time is not so important */
691         timer_reset (prg.timer, prg.lasttime = PCM_SHORT);
692         break;
693      }
694      /* writing countdown $89 ... $80 */
695      prg.stateblock++;
696      prg.prgdata = 0x89;
697      vc20_tape_byte ();
698      break;
699   case 2:
700      if (prg.prgdata != 0x81)
701      {
702         prg.prgdata--;
703         vc20_tape_byte ();
704         break;
705      }
706      prg.stateblock++;
707      vc20_tape_prgheader ();
708      break;
709   case 3:
710      timer_reset (prg.timer, prg.lasttime = PCM_LONG);
711      prg.stateblock++;
712      i = 0;
713      break;
714   case 4:
715      if (i < 80)
716      {
717         i++;
718         timer_reset (prg.timer, prg.lasttime = PCM_SHORT);
719         break;
720      }
721      /* writing countdown $09 ... $00 */
722      prg.prgdata = 9;
723      prg.stateblock++;
724      vc20_tape_byte ();
725      break;
726   case 5:
727      if (prg.prgdata != 1)
728      {
729         prg.prgdata--;
730         vc20_tape_byte ();
731         break;
732      }
733      prg.stateblock++;
734      vc20_tape_prgheader ();
735      break;
736   case 6:
737      timer_reset (prg.timer, prg.lasttime = PCM_LONG);
738      prg.stateblock++;
739      i = 0;
740      break;
741   case 7:
742      if (i < 80)
743      {
744         i++;
745         timer_reset (prg.timer, prg.lasttime = PCM_SHORT);
746         break;
747      }
748      i = 0;
749      prg.stateblock++;
750      timer_reset (prg.timer, prg.lasttime = PCM_SHORT);
751      break;
752   case 8:
753      if (i < 3000 /*5376 */ )
754      {
755         i++;
756         timer_reset (prg.timer, prg.lasttime = PCM_SHORT);
757         break;
758      }
759      prg.prgdata = 0x89;
760      prg.stateblock++;
761      vc20_tape_byte ();
762      break;
763   case 9:
764      if (prg.prgdata != 0x81)
765      {
766         prg.prgdata--;
767         vc20_tape_byte ();
768         break;
769      }
770      i = 2;
771      prg.chksum = 0;
772      prg.prgdata = prg.prg[i];
773      i++;
774      vc20_tape_byte ();
775      prg.stateblock++;
776      break;
777   case 10:
778      if (i < prg.length)
779      {
780         prg.prgdata = prg.prg[i];
781         i++;
782         vc20_tape_byte ();
783         break;
784      }
785      prg.prgdata = prg.chksum;
786      vc20_tape_byte ();
787      prg.stateblock++;
788      break;
789   case 11:
790      timer_reset (prg.timer, prg.lasttime = PCM_LONG);
791      prg.stateblock++;
792      i = 0;
793      break;
794   case 12:
795      if (i < 80)
796      {
797         i++;
798         timer_reset (prg.timer, prg.lasttime = PCM_SHORT);
799         break;
800      }
801      /* writing countdown $09 ... $00 */
802      prg.prgdata = 9;
803      prg.stateblock++;
804      vc20_tape_byte ();
805      break;
806   case 13:
807      if (prg.prgdata != 1)
808      {
809         prg.prgdata--;
810         vc20_tape_byte ();
811         break;
812      }
813      prg.chksum = 0;
814      i = 2;
815      prg.prgdata = prg.prg[i];
816      i++;
817      vc20_tape_byte ();
818      prg.stateblock++;
819      break;
820   case 14:
821      if (i < prg.length)
822      {
823         prg.prgdata = prg.prg[i];
824         i++;
825         vc20_tape_byte ();
826         break;
827      }
828      prg.prgdata = prg.chksum;
829      vc20_tape_byte ();
830      prg.stateblock++;
831      break;
832   case 15:
833      timer_reset (prg.timer, prg.lasttime = PCM_LONG);
834      prg.stateblock++;
835      i = 0;
836      break;
837   case 16:
838      if (i < 80)
839      {
840         i++;
841         timer_reset (prg.timer, prg.lasttime = PCM_SHORT);
842         break;
843      }
844      prg.stateblock = 0;
845      break;
846   }
847
848}
849
850static TIMER_CALLBACK(vc20_prg_timer)
851{
852   if (!tape.data)
853   {                           /* send the same low phase */
854      if (tape.noise)
855         dac_data_w (0, 0);
856      tape.data = 1;
857      timer_reset (prg.timer, prg.lasttime);
858   }
859   else
860   {
861      if (tape.noise)
862         dac_data_w (0, TONE_ON_VALUE);
863      tape.data = 0;
864      if (prg.statebit)
865      {
866         vc20_tape_bit (0);
867      }
868      else if (prg.statebyte)
869      {                        /* send the rest of the byte */
870         vc20_tape_byte ();
871      }
872      else if (prg.stateheader)
873      {
874         vc20_tape_prgheader ();
875      }
876      else
877      {
878         vc20_tape_program ();
879         if (!prg.stateblock)
880         {
881            tape.play = 0;
882         }
883      }
884   }
885   if (tape.read_callback)
886      tape.read_callback (machine, 0, tape.data);
887   vc20_prg_state ();
888}
889
890void vc20_tape_open (write8_machine_func read_callback)
891{
892   tape.read_callback = read_callback;
893#ifndef NEW_GAMEDRIVER
894   tape.type = 0;
895   tape.on = 0;
896   tape.noise = 0;
897   tape.play = 0;
898   tape.record = 0;
899   tape.motor = 0;
900   tape.data = 0;
901#endif
902   prg.c16 = 0;
903   wav.timer = timer_alloc(vc20_wav_timer, NULL);
904   prg.prg_timer = timer_alloc(vc20_prg_timer, NULL);
905}
906
907void c16_tape_open (void)
908{
909   vc20_tape_open (NULL);
910   prg.c16 = 1;
911}
912
913static DEVICE_IMAGE_LOAD( vc20_tape )
914{
915   const char *cp;
916
917   tape.type = 0;
918   tape.on = 0;
919   tape.noise = 0;
920   tape.play = 0;
921   tape.record = 0;
922   tape.motor = 0;
923   tape.data = 0;
924
925   cp = image_filetype(image);
926   if (!cp)
927      return INIT_FAIL;
928
929   if (mame_stricmp (cp, "wav") == 0)
930      vc20_wav_open(image);
931   else if (mame_stricmp (cp, "prg") == 0)
932      vc20_prg_open(image);
933   else
934      return INIT_FAIL;
935   return INIT_PASS;
936}
937
938static DEVICE_IMAGE_UNLOAD( vc20_tape )
939{
940   vc20_tape_close();
941}
942
943void vc20_tape_close (void)
944{
945   switch (tape.type)
946   {
947   case TAPE_WAV:
948      free (wav.sample);
949      break;
950   case TAPE_PRG:
951      free (prg.prg);
952      break;
953   }
954   /* HJB reset so vc20_tape_close() can be called multiple times!? */
955    tape.type = 0;
956}
957
958static void vc20_state (void)
959{
960   switch (tape.type)
961   {
962   case TAPE_WAV:
963      vc20_wav_state ();
964      break;
965   case TAPE_PRG:
966      vc20_prg_state ();
967      break;
968   }
969}
970
971int vc20_tape_switch (void)
972{
973   int data = 1;
974
975   switch (tape.type)
976   {
977   case TAPE_WAV:
978      data = !((wav.state > 1) && (tape.play || tape.record));
979      break;
980   case TAPE_PRG:
981      data = !((prg.state > 1) && (tape.play || tape.record));
982      break;
983   }
984   return data;
985}
986
987int vc20_tape_read (void)
988{
989   switch (tape.type)
990   {
991   case TAPE_WAV:
992      if (wav.state == 3)
993         return tape.data;
994      break;
995   case TAPE_PRG:
996      if (prg.state == 3)
997         return tape.data;
998      break;
999   }
1000   return 0;
1001}
1002
1003/* here for decoding tape formats */
1004void vc20_tape_write (int data)
1005{
1006   switch (tape.type)
1007   {
1008   case TAPE_WAV:
1009      if (wav.state == 4)
1010         vc20_wav_write (data);
1011      break;
1012   case TAPE_PRG:
1013      if (prg.state == 4)
1014         vc20_prg_write (data);
1015      break;
1016   }
1017}
1018
1019void vc20_tape_config (int on, int noise)
1020{
1021   switch (tape.type)
1022   {
1023   case TAPE_WAV:
1024      tape.on = (wav.state != 0) && on;
1025      break;
1026   case TAPE_PRG:
1027      tape.on = (prg.state != 0) && on;
1028      break;
1029   }
1030   tape.noise = tape.on && noise;
1031   vc20_state ();
1032}
1033
1034void vc20_tape_buttons (int play, int record, int stop)
1035{
1036   if (stop)
1037   {
1038      tape.play = 0, tape.record = 0;
1039   }
1040   else if (play && !tape.record)
1041   {
1042      tape.play = tape.on;
1043   }
1044   else if (record && !tape.play)
1045   {
1046      tape.record = tape.on;
1047   }
1048   vc20_state ();
1049}
1050
1051void vc20_tape_motor (int data)
1052{
1053   tape.motor = !data;
1054   vc20_state ();
1055}
1056
1057void vc20_tape_status (char *text, int size)
1058{
1059   text[0] = 0;
1060   switch (tape.type)
1061   {
1062   case TAPE_WAV:
1063      switch (wav.state)
1064      {
1065      case 4:
1066         snprintf (text, size, "Tape saving");
1067         break;
1068      case 3:
1069         /* NPW 28-Feb-2005 - this code sucks */
1070#if 0
1071         snprintf (text, size, "Tape (%s) loading %d/%dsec",
1072                 image_filename(wav.img),
1073                 wav.pos / wav.sample->smpfreq,
1074                 wav.sample->length / wav.sample->smpfreq);
1075#endif
1076         break;
1077      }
1078      break;
1079   case TAPE_PRG:
1080      switch (prg.state)
1081      {
1082      case 4:
1083         snprintf (text, size, "Tape saving");
1084         break;
1085      case 3:
1086         snprintf (text, size, "Tape (%s) loading %d",
1087            image_filename(prg.img), prg.pos);
1088         break;
1089      }
1090      break;
1091   }
1092}
1093
1094
1095
1096void vc20tape_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
1097{
1098   switch(state)
1099   {
1100      /* --- the following bits of info are returned as 64-bit signed integers --- */
1101      case MESS_DEVINFO_INT_TYPE:                     info->i = IO_CASSETTE; break;
1102      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
1103
1104      /* --- the following bits of info are returned as pointers to data or functions --- */
1105      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(vc20_tape); break;
1106      case MESS_DEVINFO_PTR_UNLOAD:                  info->unload = DEVICE_IMAGE_UNLOAD_NAME(vc20_tape); break;
1107
1108      /* --- the following bits of info are returned as NULL-terminated strings --- */
1109      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "wav"); break;
1110   }
1111}
1112
src/mess/machine/c65.c
r3189r3190
785785   memory_set_bankptr(14, c64_memory + 0x0c000);
786786   memory_set_bankptr(15, c64_memory + 0x0e000);
787787
788   c64_tape_on = 1;
788   /* C65 had no datasette port */
789   c64_tape_on = 0;
790
789791   /*memset(c64_memory+0x40000, 0, 0x800000-0x40000); */
790792
791793   {
src/mess/machine/c128.c
r3189r3190
834834   {
835835      if (direction & 0x08)
836836      {
837      /* CASSETTE_RECORD is not implemented yet */
837         cassette_output(image_from_devtype_and_index(IO_CASSETTE, 0), (data & 0x08) ? -(0x5a9e >> 1) : +(0x5a9e >> 1));
838838      }
839839
840840      if (direction & 0x20)
r3189r3190
863863   running_machine *machine = Machine;
864864   UINT8 data = c64_port_data;
865865
866   if ((cassette_get_state(image_from_devtype_and_index(IO_CASSETTE, 0)) & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY)
866   if ((cassette_get_state(image_from_devtype_and_index(IO_CASSETTE, 0)) & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED)
867867      data &= ~0x10;
868868   else
869869      data |=  0x10;
src/mess/machine/vc20.c
r3189r3190
117117   if (!serial_data || !cbm_serial_data_read ())
118118      value &= ~0x02;
119119
120   if ((cassette_get_state(image_from_devtype_and_index(IO_CASSETTE, 0)) & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY)
120   if ((cassette_get_state(image_from_devtype_and_index(IO_CASSETTE, 0)) & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED)
121121      value &= ~0x40;
122122   else
123123      value |=  0x40;
r3189r3190
319319static WRITE8_HANDLER( vc20_via1_write_portb )
320320{
321321/*  logerror("via1_write_portb: $%02X\n", data); */
322//   vc20_tape_write (data & 0x08 ? 1 : 0);      // CASSETTE_RECORD not implemeted yet!
322   cassette_output(image_from_devtype_and_index(IO_CASSETTE, 0), (data & 0x08) ? -(0x5a9e >> 1) : +(0x5a9e >> 1));
323323   via1_portb = data;
324324}
325325
src/mess/machine/c64.c
r3189r3190
1313 */
1414
1515/*
16   2008-09-05: Tape status [FP & RZ]
16   2008-09-06: Tape status for C64 & C128 [FP & RZ]
1717   - tape loading works
1818   - tap files are supported
19   
20   TODO:
21   * write to tape
19   - tape writing works
2220*/
2321
2422#include "driver.h"
r3189r3190
768766   {
769767      if (direction & 0x08)
770768      {
771      /* CASSETTE_RECORD is not implemented yet */
769         cassette_output(image_from_devtype_and_index(IO_CASSETTE, 0), (data & 0x08) ? -(0x5a9e >> 1) : +(0x5a9e >> 1));
772770      }
773771
774772      if (direction & 0x20)
r3189r3190
806804
807805   if (c64_tape_on)
808806   {
809      if ((cassette_get_state(image_from_devtype_and_index(IO_CASSETTE, 0)) & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY)
807      if ((cassette_get_state(image_from_devtype_and_index(IO_CASSETTE, 0)) & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED)
810808         data &= ~0x10;
811809      else
812810         data |=  0x10;
src/mess/drivers/c65.c
r3189r3190
88
99***************************************************************************/
1010
11/*
12
132008 - Driver Updates
14---------------------
15
16(most of the informations are taken from http://www.zimmers.net/cbmpics/ )
17
18
19[CBM systems which belong to this driver]
20
21* Commodore 65 (1989)
22
23Also known as C64 DX at early stages of the project. It was cancelled
24around 1990-1991. Only few units survive (they were sold after Commodore
25liquidation in 1994).
26
27CPU: CSG 4510 (3.54 Mhz)
28RAM: 128 kilobytes, expandable to 8 megabytes
29ROM: 128 kilobytes
30Video: CSG 4569 "VIC-III" (6 Video modes; Resolutions from 320x200 to
31   1280x400; 80 columns text; Palette of 4096 colors)
32Sound: CSG 8580 "SID" x2 (6 voice stereo synthesizer/digital sound
33   capabilities)
34Ports: CSG 4510 (2 Joystick/Mouse ports; CBM Serial port; CBM 'USER'
35   port; CBM Monitor port; Power and reset switches; C65 bus drive
36   port; RGBI video port; 2 RCA audio ports; RAM expansion port; C65
37   expansion port)
38Keyboard: Full-sized 77 key QWERTY (12 programmable function keys;
39   4 direction cursor-pad)
40Additional Hardware: Built in 3.5" DD disk drive (1581 compatible)
41Miscellaneous: Partially implemented Commodore 64 emulation
42
43[Notes]
44
45The datasette port was removed here. C65 supports an additional "dumb"
46drive externally. It also features, in addition to the standard CBM
47bus serial (available in all modes), a Fast and a Burst serial bus
48(both available in C65 mode only)
49
50*/
51
52
1153#include "driver.h"
1254#include "includes/c65.h"
1355#include "includes/c64.h"
r3189r3190
2365#include "includes/vc1541.h"
2466
2567
68/*************************************
69 *
70 *  Main CPU memory handlers
71 *
72 *************************************/
73
2674static ADDRESS_MAP_START( c65_mem , ADDRESS_SPACE_PROGRAM, 8)
2775   AM_RANGE(0x00000, 0x07fff) AM_RAMBANK(11)
2876   AM_RANGE(0x08000, 0x09fff) AM_READWRITE(SMH_BANK1, SMH_BANK12)
r3189r3190
119167
120168
121169
170/*************************************
171 *
172 *  Graphics definitions
173 *
174 *************************************/
175
176
122177static PALETTE_INIT( c65 )
123178{
124179   int i;
r3189r3190
128183   }
129184}
130185
131#if 0
132   /* caff */
133   /* dma routine alpha 1 (0x400000 reversed copy)*/
134   ROM_LOAD ("910111.bin", 0x20000, 0x20000, CRC(c5d8d32e) SHA1(71c05f098eff29d306b0170e2c1cdeadb1a5f206))
135   /* b96b */
136   /* dma routine alpha 2 */
137   ROM_LOAD ("910523.bin", 0x20000, 0x20000, CRC(e8235dd4) SHA1(e453a8e7e5b95de65a70952e9d48012191e1b3e7))
138   /* 888c */
139   /* dma routine alpha 2 */
140   ROM_LOAD ("910626.bin", 0x20000, 0x20000, CRC(12527742) SHA1(07c185b3bc58410183422f7ac13a37ddd330881b))
141   /* c9cd */
142   /* dma routine alpha 2 */
143   ROM_LOAD ("910828.bin", 0x20000, 0x20000, CRC(3ee40b06) SHA1(b63d970727a2b8da72a0a8e234f3c30a20cbcb26))
144   /* 4bcf loading demo disk??? */
145   /* basic program stored at 0x4000 ? */
146   /* dma routine alpha 2 */
147   ROM_LOAD ("911001.bin", 0x20000, 0x20000, CRC(0888b50f) SHA1(129b9a2611edaebaa028ac3e3f444927c8b1fc5d))
148   /* german e96a */
149   /* dma routine alpha 1 */
150   ROM_LOAD ("910429.bin", 0x20000, 0x20000, CRC(b025805c) SHA1(c3b05665684f74adbe33052a2d10170a1063ee7d))
151#endif
152186
153ROM_START( c65 )
154   ROM_REGION (0x400000, "main", 0)
155   ROM_SYSTEM_BIOS( 0, "910111", "V0.9.910111" )
156   ROMX_LOAD( "910111.bin", 0x20000, 0x20000, CRC(c5d8d32e) SHA1(71c05f098eff29d306b0170e2c1cdeadb1a5f206), ROM_BIOS(1) )
157   ROM_SYSTEM_BIOS( 1, "910523", "V0.9.910523" )
158   ROMX_LOAD( "910523.bin", 0x20000, 0x20000, CRC(e8235dd4) SHA1(e453a8e7e5b95de65a70952e9d48012191e1b3e7), ROM_BIOS(2) )
159   ROM_SYSTEM_BIOS( 2, "910626", "V0.9.910626" )
160   ROMX_LOAD( "910626.bin", 0x20000, 0x20000, CRC(12527742) SHA1(07c185b3bc58410183422f7ac13a37ddd330881b), ROM_BIOS(3) )
161   ROM_SYSTEM_BIOS( 3, "910828", "V0.9.910828" )
162   ROMX_LOAD( "910828.bin", 0x20000, 0x20000, CRC(3ee40b06) SHA1(b63d970727a2b8da72a0a8e234f3c30a20cbcb26), ROM_BIOS(4) )
163   ROM_SYSTEM_BIOS( 4, "911001", "V0.9.911001" )
164   ROMX_LOAD( "911001.bin", 0x20000, 0x20000, CRC(0888b50f) SHA1(129b9a2611edaebaa028ac3e3f444927c8b1fc5d), ROM_BIOS(5) )
165ROM_END
187/*************************************
188 *
189 *  Sound definitions
190 *
191 *************************************/
166192
167ROM_START( c64dx )
168   ROM_REGION (0x400000, "main", 0)
169   ROM_LOAD ("910429.bin", 0x20000, 0x20000, CRC(b025805c) SHA1(c3b05665684f74adbe33052a2d10170a1063ee7d))
170ROM_END
171193
172194static const sid6581_interface c65_sound_interface =
173195{
174196   c64_paddle_read
175197};
176198
199
200
201/*************************************
202 *
203 *  Machine driver
204 *
205 *************************************/
206
207
177208static MACHINE_DRIVER_START( c65 )
178209   /* basic machine hardware */
179210   MDRV_CPU_ADD("main", M4510, 3500000)  /* or VIC6567_CLOCK, */
r3189r3190
222253   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.50)
223254MACHINE_DRIVER_END
224255
256
257
258/*************************************
259 *
260 *  ROM definition(s)
261 *
262 *************************************/
263
264
265ROM_START( c65 )
266   ROM_REGION( 0x400000, "main", 0 )
267   ROM_SYSTEM_BIOS( 0, "910111", "V0.9.910111" )
268   ROMX_LOAD( "910111.bin", 0x20000, 0x20000, CRC(c5d8d32e) SHA1(71c05f098eff29d306b0170e2c1cdeadb1a5f206), ROM_BIOS(1) )
269   ROM_SYSTEM_BIOS( 1, "910523", "V0.9.910523" )
270   ROMX_LOAD( "910523.bin", 0x20000, 0x20000, CRC(e8235dd4) SHA1(e453a8e7e5b95de65a70952e9d48012191e1b3e7), ROM_BIOS(2) )
271   ROM_SYSTEM_BIOS( 2, "910626", "V0.9.910626" )
272   ROMX_LOAD( "910626.bin", 0x20000, 0x20000, CRC(12527742) SHA1(07c185b3bc58410183422f7ac13a37ddd330881b), ROM_BIOS(3) )
273   ROM_SYSTEM_BIOS( 3, "910828", "V0.9.910828" )
274   ROMX_LOAD( "910828.bin", 0x20000, 0x20000, CRC(3ee40b06) SHA1(b63d970727a2b8da72a0a8e234f3c30a20cbcb26), ROM_BIOS(4) )
275   ROM_SYSTEM_BIOS( 4, "911001", "V0.9.911001" )
276   ROMX_LOAD( "911001.bin", 0x20000, 0x20000, CRC(0888b50f) SHA1(129b9a2611edaebaa028ac3e3f444927c8b1fc5d), ROM_BIOS(5) )
277ROM_END
278
279ROM_START( c64dx )
280   ROM_REGION( 0x400000, "main", 0 )
281   ROM_LOAD( "910429.bin", 0x20000, 0x20000, CRC(b025805c) SHA1(c3b05665684f74adbe33052a2d10170a1063ee7d) )
282ROM_END
283
284
285/*************************************
286 *
287 *  System configuration(s)
288 *
289 *************************************/
290
291
225292static SYSTEM_CONFIG_START( c65 )
226293   CONFIG_DEVICE(c64_cartslot_getinfo)   // to investigate which carts could work in the c65 expansion port!
227294   CONFIG_DEVICE(cbmfloppy_device_getinfo)
r3189r3190
230297   CONFIG_RAM((128 + 4096) * 1024)
231298SYSTEM_CONFIG_END
232299
233/*    YEAR  NAME    PARENT  COMPAT  MACHINE INPUT   INIT    CONFIG  COMPANY                         FULLNAME                                                            FLAGS */
234COMP( 1991, c65,    0,      0,      c65,    c65,    c65,    c65,    "Commodore Electronics, Ltd.",  "The Commodore 65 Development System (Prototype, NTSC)",            GAME_NOT_WORKING )
235COMP( 1991, c64dx,  c65,    0,      c65pal, c65ger, c65pal, c65,    "Commodore Electronics, Ltd.",  "The Commodore 64DX Development System (Prototype, PAL, German)",   GAME_NOT_WORKING )
300
301/***************************************************************************
302
303  Game driver(s)
304
305***************************************************************************/
306
307/*    YEAR  NAME    PARENT  COMPAT  MACHINE INPUT   INIT    CONFIG  COMPANY                         FULLNAME                                              FLAGS */
308
309COMP( 1991, c65,    0,      0,      c65,    c65,    c65,    c65,    "Commodore Electronics, Ltd.",  "Commodore 65 Development System (Prototype, NTSC)", GAME_NOT_WORKING )
310COMP( 1991, c64dx,  c65,    0,      c65pal, c65ger, c65pal, c65,    "Commodore Electronics, Ltd.",  "Commodore 64DX Development System (Prototype, PAL, German)", GAME_NOT_WORKING )
src/mess/drivers/c128.c
r3189r3190
99***************************************************************************/
1010
1111/*
12------------------------------------
13c128    commodore c128 (ntsc version)
14c128ger commodore c128 german (pal version)
15------------------------------------
16(preliminary version)
1712
18if the game runs to fast with the ntsc version, try the pal version!
19flickering affects in one video version, try the other video version
132008 - Driver Updates
14---------------------
2015
21c128
22 hardware emulation mode for c64
23  displayed over din/tv connector only
24  c64 cartridges
25  c64 userport
26  only the c64 standard keys available
27 country support (keyboard, character rom, kernel (keyboard polling))
28  character rom german
29  character rom french, belgium, italian
30  editor, kernel for german
31  editor, kernel for swedish
32  editor, kernel for finish
33  editor, kernel for norwegian
34  editor, kernel for french
35  editor, kernel for italian
36 enhanced keyboard
37 m8502 processor (additional port pin)
38 additional vdc videochip for 80 column modes with own connector (rgbi)
39  16k byte ram for this chip
40 128 kbyte ram, 64 kbyte rom, 8k byte charrom, 2k byte static colorram
41  (1 mbyte ram possible)
42 sid6581 soundchip
43 c64 expansion port with some additional pins
44 z80 cpu for CPM mode
45c128d
46 c1571 floppy drive build in
47 64kb vdc ram
48 sid8580 sound chip
49c128cr/c128dcr
50 cost reduced
51 only modified for cheaper production (newer rams, ...)
16(most of the informations are taken from http://www.zimmers.net/cbmpics/ )
5217
53state
54-----
55uses c64 emulation for c64 mode
56so only notes for the additional subsystems here
5718
58rasterline based video system
59 no cpu holding
60 imperfect scrolling support (when 40 columns or 25 lines)
61 lightpen support not finished
62 rasterline not finished
63vdc emulation
64 dirtybuffered video system
65 text mode
66  only standard 8x8 characters supported
67 graphic mode not tested
68 lightpen not supported
69 scrolling not supported
70z80 emulation
71 floppy simulation not enough for booting CPM
72 so simplified z80 memory management not tested
73no cpu clock doubling
74no internal function rom
75c64 mode
76 differences to real c64???
77no sound
78cia6526's look in machine/cia6526.c
79keyboard
80gameport a
81 paddles 1,2
82 joystick 1
83 2 button joystick/mouse joystick emulation
84 no mouse
85 lightpen (not finished)
86gameport b
87 paddles 3,4
88 joystick 2
89 2 button joystick/mouse joystick emulation
90 no mouse
91simple tape support
92 (not working, cia timing, cpu timing?)
93serial bus
94 simple disk drives
95 no printer or other devices
96expansion modules
97 no c128 modules
98expansion modules c64
99 rom cartridges (exrom)
100 ultimax rom cartridges (game)
101 c64 cartridges (only standard rom cartridges)
102 no other rom cartridges (bankswitching logic in it, switching exrom, game)
103 no ieee488 support
104 no cpm cartridge
105 no speech cartridge (no circuit diagram found)
106 no fm sound cartridge
107 no other expansion modules
108no userport
109 no rs232/v.24 interface
110quickloader
19[CBM systems which belong to this driver]
11120
112Keys
113----
114Some PC-Keyboards does not behave well when special two or more keys are
115pressed at the same time
116(with my keyboard printscreen clears the pressed pause key!)
21* Commodore 128 (1985)
11722
118shift-cbm switches between upper-only and normal character set
119(when wrong characters on screen this can help)
120run (shift-stop) loads pogram from type and starts it
121esc-x switch between two videosystems
23CPU: CSG 8502 (1 or 2 Mhz), Z80 (~3 Mhz)
24RAM: 128 kilobytes
25ROM: 72 kilobytes expandable
26Video: MOS 8564 "VIC-II", MOS 8563 CTRC (40/80 columns text; Palette of 16
27   colors; Hires modes 320 x 200, 640 x 200
28Sound: MOS 8580 "SID" (3 voice stereo synthesizer/digital sound
29   capabilities)
30Ports: MOS 6526 CIA x2 (2 Joystick/Mouse ports; CBM Serial port; CBM
31   Datasette port; parallel programmable "User" port; CBM Monitor port;
32   C64 expansion port; Warm reset switch; Keyboard port; Power switch)
33Keyboard: Full-sized 93 key QWERTY (14 key numeric keypad; 8 programmable
34   function keys + HELP; 4 direction 4-key cursor-pad)
12235
123additional keys (to c64) are in c64mode not useable
12436
125Lightpen
126--------
127Paddle 5 x-axe
128Paddle 6 y-axe
37* Commodore 128CR (198?)
12938
130Tape
131----
132(DAC 1 volume in noise volume)
133loading of wav, prg and prg files in zip archiv
134commandline -cassette image
135wav:
136 8 or 16(not tested) bit, mono, 125000 Hz minimum
137 has the same problems like an original tape drive (tone head must
138 be adjusted to get working(no load error,...) wav-files)
139zip:
140 must be placed in current directory
141 prg's are played in the order of the files in zip file
39  Basically, a C128 in a redesigned board to reduce production costs. It's
40not clear when it's been produced, nor if it has ever been produced on
41large scale. Its BIOS is an intermediate revision between rev. 0 and rev. 1
42in the main C128.
43A picture of the PCB can be found here:
44http://www.zimmers.net/anonftp/pub/cbm/schematics/computers/c128/c128cr.jpg
14245
143use LOAD or LOAD"" or LOAD"",1 for loading of normal programs
144use LOAD"",1,1 for loading programs to their special address
14546
146several programs relies on more features
147(loading other file types, writing, ...)
47* Commodore 128D (1985)
14848
149Discs
150-----
151only file load from drive 8 and 9 implemented
152 loads file from rom directory (*.prg,*.p00) (must NOT be specified on commandline)
153 or file from d64 image (here also directory LOAD"$",8 supported)
154use LOAD"filename",8
155or LOAD"filename",8,1 (for loading machine language programs at their address)
156for loading
157type RUN or the appropriate sys call to start them
49  Designed in the US, but only sold in Europe, it is a C128 in a desktop
50case, with built-in 1571 disk drive (upgraded with a special software to
51discourage pirating software). Some NTSC prototypes exist.
15852
159several programs rely on more features
160(loading other file types, writing, ...)
53CPU: CSG 8502 (1 or 2 Mhz), Z80 (~3 Mhz), 6502 (co-processor for disk
54   drive)
55RAM: 128 kilobytes
56ROM: 72 kilobytes expandable
57Video: MOS 8564 "VIC-II", MOS 8563 CTRC (40/80 columns text; Palette of 16
58   colors; Hires modes 320 x 200, 640 x 200
59Sound: MOS 8580 "SID" (3 voice stereo synthesizer/digital sound
60   capabilities)
61Ports: MOS 6526 CIA x2 (2 Joystick/Mouse ports; CBM Serial port; CBM
62   Datasette port; parallel programmable "User" port; CBM Monitor port;
63   C64 expansion port; Warm reset switch; Keyboard port; Power switch)
64Keyboard: Full-sized 93 key QWERTY (14 key numeric keypad; 8 programmable
65   function keys + HELP; 4 direction 4-key cursor-pad)
66Additional Hardware: Internal 1571 disk drive (Double sided/Double Density
67   360k; capable of reading GCR and MFM formats)
16168
162most games rely on starting own programs in the floppy drive
163(and therefor cpu level emulation is needed)
16469
165Roms
166----
167.prg
168.crt
169.80 .90 .a0 .b0 .e0 .f0
170files with boot-sign in it
171  recogniced as roms
70* Commodore 128DCR (1986)
17271
173.prg files loaded at address in its first two bytes
174.?0 files to address specified in extension
175.crt roms to addresses in crt file
72  Basically, a C128D in a redesigned board to reduce production costs. It's
73the only model sold in the US, but it's quite possible that it came later
74in Europe as well (being cheaper to produce).
17675
177Quickloader
178-----------
179.prg and .p00 files supported
180loads program into memory and sets program end pointer
181(works with most programs)
182program ready to get started with RUN
183loads first rom when you press quickload key (numeric slash)
18476
185c64 mode
186--------
187hold down commodore key while reseting or turning on
188type go64 at the c128 command mode
77* Commodore "128D/81" (198?)
18978
190cpm mode
191--------
192cpm disk must be inserted in device 8
193turn on computer
194or
195type boot at the c128 command mode
79  NTSC prototype for an improved version of C128D, featuring a built-in 1581
80disk drive in place of the 1571 used in C128D / C128DCR. The prototype has no
81given name, so C128D/81 is just a reasonable way to indicate it. The case is
82from a PAL C128D and the board is a heavily modified PAL board with hand
83soldered connections to make it NTSC.
19684
197when problems start with -log and look into error.log file
19885
199rom dumping
200-----------
86[TO DO]
20187
202Dumping of the roms from the running machine:
203in the monitor program
204s "drive:name",device,start,end
88* C64 Mode
20589
206s "0:basic",8,f4000,fc000
207s "0:editor",8,fc000,fd000
208s "0:kernel",8,ee000,f0000
209s "0:char128",8,ed000,ee000
90  See [TO DO] in drivers/c64.c for the missing features.
21091
211*z80bios missing (funet says only 1 version!?)
212I don't know, maybe there is a cpm utility allowing saving
213the memory area 0-0xfff of bank 0.
214(I don't want to develope (and cant test) this short complicated
215program)
21692
217*c64basic and kernel (only 1 version!?)
218in c64 mode
219poke43,0:poke44,160:poke45,0:poke46,192:save"0:basic64",8
93* C/PM Mode
22094
221in c64 mode
222for i=0 to 8191:poke 32*256+i, peek(224*256+i): next
223poke43,0:poke44,32:poke45,0:poke46,64:save"0:kernel64",8
95  It should work if you put the CP/M disk in drive 8 and enter BOOT. Better
96disk emulation would be of help, anyway.
22497
225*c64 charset (swedish version or original c64 version)
226in c128 mode
227monitor
228a 2000 sei
229lda #33
230sta 1
231ldy #0
232sty fa
233sty fc
234lda #c0
235sta fd
236lda #d0
237sta fb
238ldx #10
239lda (fa),y
240sta (fc),y
241iny
242bne 2015
243inc fb
244inc fd
245dex
246bne 2015
247lda #37
248sta 1
249cli
250rts
251(additional enter to end assembler input)
252x (to leave monitor)
253go64 (answer with y)
254sys 32*256
255poke 43,0:poke44,192:poke45,0:poke46,208:save"0:char64",8
98* C128 Mode
25699
257or in c64 mode
258load the program in the attachment
259load"savechar64",8,1
260sys 32*256
261poke 43,0:poke44,192:poke45,0:poke46,208:save"0:char64",8
100  Various missing features (e.g. no cpu clock doubling; no internal function
101rom; serial bus doesn't support printer or other devices; no C128 cart
102expansions are supported; no userport; no rs232/v.24 interface)
262103
263c128d floppy disk bios:
264I think you have to download a program
265copying the bios to puffers.
266Then you could read this buffer into the computer, or write
267these buffers to disk.
104* Informations / BIOS / Supported Sets:
268105
269Transportation to your pc:
2701571 writing to mfm encoded disketts (in cpm mode only, or use program)
271 maybe the IBM CPM-86 formats are like the standard DOS formats.
272 but using dd may create images known by some other emulators.
2731581 writes mfm encoded:
274 can one of these drives to a format know by linux?
275Some years ago I build a simple adapter pc/parport to vc1541
276 floppy disk drive.
106- Was C128D using rev. 1 BIOS in 4 ROMs? I guessed so because the board has the
107same desing as a C128, and later C128DCR still used rev. 1 BIOS (only contained
108in two ROMs)
277109
278Dumping roms with epromer
279-------------------------
280c128
281U18       (read compatible 2764?) 8kB c64 character rom, c128 character rom
282U32 23128 (read compatible 27128?) 16kB c64 Basic, c64 Kernel
283U33 23128 (read compatible 27128?) 16kB c128 Basic at 0x4000
284U34 23128 (read compatible 27128?) 16kB c128 Basic at 0x8000
285U35 23128 (read compatible 27128?) 16kB c128 Editor, Z80Bios, C128 Kernel
286c128 cost reduced
287U18       (read compatible 2764?) 8kB c64 character rom, c128 character rom
288U32 23256 (read compatible 27256?) 32kB c64 Basic, c64 Kernel, c128 Editor, Z80Bios, C128 Kernel
289U34 23256 (read compatible 27256?) 32kB C128 Basic
290c128dcr
291as c128 cr
292U102 23256 (read compatible 27256?) 32kB 1571 system rom
110- Is it possible to track down and dump properly C128 PAL BIOSes? Current sets
111are mostly tagged as bad dumps because obtained by extracting the content in
112pieces. I'd like to have confirmation that the common parts are really the same
113before removing the flag.
293114
115- PAL BIOSes are from C128? C128D? or C128DCR? Were there differences in the
116contents between them, except for being splitted in 2 or 4 parts? Were all
117versions sold in each country? Right now we choose to support the following sets
118(more to be added if BIOS content confirmed):
119
120+ German, Italian and Swedish dumps are known to come from a C128DCR. Therefore,
121we support c128drde, c128drit and c128drsw.
122
123+ We also have a dump of the German C128, therefore we support the c128ger, even
124if it's not clear which BASIC version it was shipped with. We assumed the older
125kernal to be shipped with rev. 0 and the newer with rev. 1.
126
127+ The Finnish, French and Norwegian dumps came with no notes (or these have been
128lost). Therefore we support only the c128 for these, i.e. c128fin, c128fre and
129c128nor.
130
131+ Character ROM for Belgium, Italy and French was the same (I/F/B on the label,
132and indeed it turned out to be the same on both the Italian and French C128)
133
134- Also, the italian C128DCR was found with a rev. 0 BASIC on it. Were both rev. 0
135and rev. 1 used in the CR version? When did Commodore switch between the two?
136
137[Notes about dumping BIOS]
138
139Dumping roms with eeprom reader
140-------------------------------
141
142c128 / c128d
143
144   U18       (read compatible 2764?) 8kB c64 character rom, c128 character rom
145   U32 23128 (read compatible 27128?) 16kB c64 Basic, c64 Kernel
146   U33 23128 (read compatible 27128?) 16kB c128 Basic at 0x4000
147   U34 23128 (read compatible 27128?) 16kB c128 Basic at 0x8000
148   U35   23128 (read compatible 27128?) 16kB c128 Editor, Z80BIOS, c128 Kernel
149
150c128cr / c128dcr
151
152   U18       (read compatible 2764?) 8kB c64 character rom, c128 character rom
153   U32 23256 (read compatible 27256?) 32kB c64 Basic + Kernel, c128 Editor, Z80BIOS, c128 Kernel
154   U34 23256 (read compatible 27256?) 32kB c128 Basic
155
156c128d / c128dcr also need:
157
158   U102 23256 (read compatible 27256?) 32kB 1571 system rom
159
160
161It would be also possible to dump the BIOS in monitor, but it would be preferable
162to use an EEPROM reader, in order to obtain a dump of the whole content.
294163*/
295164
165
296166#include "driver.h"
297167#include "sound/sid6581.h"
298168#include "machine/6526cia.h"
r3189r3190
308178#include "includes/c64.h"
309179
310180
181/*************************************
182 *
183 *  Main CPU memory handlers
184 *
185 *************************************/
186
187
311188/* shares ram with m8502
312189 * how to bankswitch ?
313190 * bank 0
r3189r3190
595472INPUT_PORTS_END
596473
597474
475/*************************************
476 *
477 *  Graphics definitions
478 *
479 *************************************/
598480
481
599482static PALETTE_INIT( c128 )
600483{
601484   int i;
r3189r3190
642525   GFXDECODE_ENTRY( "gfx2", 0x0000, c128graphic_charlayout, 0, 0x100 )
643526GFXDECODE_END
644527
645#if 0
646/* usa first 318018-02 318019-02 318020-03 rev 0*/
647528
648/* usa mid 318018-03 318019-03 318020-04 */
649529
650/* usa last 318018-04 318019-04 318020-05 rev 1*/
651/* usa dcr 318022-02 318023-02, same as usa last */
530/*************************************
531 *
532 *  Sound definitions
533 *
534 *************************************/
652535
653/* between rev0 and rev1 252343-03+252343-04 */
654536
655    ROM_LOAD ("basic-4000.318018-02.bin", 0x100000, 0x4000, CRC(2ee6e2fa))
656    ROM_LOAD ("basic-8000.318019-02.bin", 0x104000, 0x4000, CRC(d551fce0))
657     /* same as above, but in one chip */
658     ROM_LOAD ("basic.318022-01.bin", 0x100000, 0x8000, CRC(e857df90))
659
660   /* maybe 318018-03+318019-03 */
661    ROM_LOAD ("basic.252343-03.bin", 0x100000, 0x8000, CRC(bc07ed87))
662
663   /* 1986 final upgrade */
664    ROM_LOAD ("basic-4000.318018-04.bin", 0x100000, 0x4000, CRC(9f9c355b))
665    ROM_LOAD ("basic-8000.318019-04.bin", 0x104000, 0x4000, CRC(6e2c91a7))
666     /* same as above, but in one chip */
667    ROM_LOAD ("basic.318022-02.bin", 0x100000, 0x8000, CRC(af1ae1e8))
668
669    ROM_LOAD ("64c.251913-01.bin", 0x108000, 0x4000, CRC(0010ec31))
670
671    /* editor, z80 bios, c128kernel */
672    ROM_LOAD ("kernal.318020-03.bin", 0x10c000, 0x4000, CRC(1e94bb02))
673    ROM_LOAD ("kernal.318020-05.bin", 0x10c000, 0x4000, CRC(ba456b8e))
674    ROM_LOAD ("kernal.german.315078-01.bin", 0x10c000, 0x4000, CRC(a51e2168))
675    ROM_LOAD ("kernal.german.315078-02.bin", 0x10c000, 0x4000, CRC(b275bb2e))
676    /* 0x3e086a24 z80bios 0xca5e1179*/
677    ROM_LOAD ("french.bin", 0x10c000, 0x4000, CRC(2df282b8))
678    /* 0x71002a97 z80bios 0x167b8364*/
679    ROM_LOAD ("finnish1.bin", 0x10c000, 0x4000, CRC(d3ecea84))
680    /* 0xb7ff5efe z80bios 0x5ce42fc8 */
681    ROM_LOAD ("finnish2.bin", 0x10c000, 0x4000, CRC(9526fac4))
682   /* 0x8df58148 z80bios 0x7b0d2140 */
683    ROM_LOAD ("italian.bin", 0x10c000, 0x4000, CRC(74d6b084))
684    /* 0x84c55911 z80bios 0x3ba48012 */
685    ROM_LOAD ("norwegian.bin", 0x10c000, 0x4000, CRC(a5406848))
686
687    /* c64 basic, c64 kernel, editor, z80 bios, c128kernel */
688   /* 252913-01+318020-05 */
689    ROM_LOAD ("complete.318023-02.bin", 0x100000, 0x8000, CRC(eedc120a))
690   /* 252913-01+0x98f2a2ed maybe 318020-04*/
691    ROM_LOAD ("complete.252343-04.bin", 0x108000, 0x8000, CRC(cc6bdb69))
692   /* 251913-01+0xbff7550b */
693    ROM_LOAD ("complete.german.318077-01.bin", 0x108000, 0x8000, CRC(eb6e2c8f))
694     /* chip label says Ker.Sw/Fi  */
695   /* 901226.01+ 0xf10c2c25 +0x1cf7f729 */
696    ROM_LOAD ("complete.swedish.318034-01.bin", 0x108000, 0x8000, CRC(cb4e1719))
697
698    ROM_LOAD ("characters.390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6))
699    ROM_LOAD ("characters.german.315079-01.bin", 0x120000, 0x2000, CRC(fe5a2db1))
700    /* chip label says I/F/B (belgium, italian, french)  characters */
701     /* italian and french verified to be the same*/
702    ROM_LOAD ("characters.french.325167-01.bin", 0x120000, 0x2000, CRC(bad36b88))
703
704    /* only parts of system roms, so not found in any c128 variant */
705    ROM_LOAD ("editor.finnish1.bin", 0x10c000, 0x1000, CRC(71002a97))
706    ROM_LOAD ("editor.finnish2.bin", 0x10c000, 0x1000, CRC(b7ff5efe))
707    ROM_LOAD ("editor.french.bin", 0x10c000, 0x1000, CRC(3e086a24))
708    ROM_LOAD ("editor.italian.bin", 0x10c000, 0x1000, CRC(8df58148))
709    ROM_LOAD ("editor.norwegian.bin", 0x10c000, 0x1000, CRC(84c55911))
710
711    ROM_LOAD ("kernalpart.finnish1.bin", 0x10e000, 0x2000, CRC(167b8364))
712    ROM_LOAD ("kernalpart.finnish2.bin", 0x10e000, 0x2000, CRC(5ce42fc8))
713    ROM_LOAD ("kernalpart.french.bin", 0x10e000, 0x2000, CRC(ca5e1179))
714    ROM_LOAD ("kernalpart.italian.bin", 0x10e000, 0x2000, CRC(7b0d2140))
715    ROM_LOAD ("kernalpart.norwegian.bin", 0x10e000, 0x2000, CRC(3ba48012))
716
717    ROM_LOAD ("z80bios.bin", 0x10d000, 0x1000, CRC(c38d83c6))
718
719    /* function rom in internal socket */
720    ROM_LOAD("super_chip.bin", 0x110000, 0x8000, CRC(a66f73c5))
721#endif
722
723ROM_START (c128)
724   ROM_REGION (0x132800, "main", 0)
725   ROM_LOAD ("318018.04", 0x100000, 0x4000, CRC(9f9c355b) SHA1(d53a7884404f7d18ebd60dd3080c8f8d71067441))
726   ROM_LOAD ("318019.04", 0x104000, 0x4000, CRC(6e2c91a7) SHA1(c4fb4a714e48a7bf6c28659de0302183a0e0d6c0))
727   ROM_LOAD ("251913.01", 0x108000, 0x4000, CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88))
728   ROM_LOAD ("318020.05", 0x10c000, 0x4000, CRC(ba456b8e) SHA1(ceb6e1a1bf7e08eb9cbc651afa29e26adccf38ab))
729   ROM_LOAD ("390059.01", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f))
730   ROM_REGION (0x10000, "m8502", ROMREGION_ERASEFF)
731   ROM_REGION (0x2000, "gfx1", ROMREGION_ERASEFF)
732   ROM_REGION (0x100, "gfx2", ROMREGION_ERASEFF)
733ROM_END
734
735ROM_START (c128d)
736   ROM_REGION (0x132800, "main", 0)
737   ROM_LOAD ("318022.02", 0x100000, 0x8000, CRC(af1ae1e8) SHA1(953dcdf5784a6b39ef84dd6fd968c7a03d8d6816))
738   ROM_LOAD ("318023.02", 0x108000, 0x8000, CRC(eedc120a) SHA1(f98c5a986b532c78bb68df9ec6dbcf876913b99f))
739   ROM_LOAD ("390059.01", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f))
740   ROM_REGION (0x10000, "m8502", ROMREGION_ERASEFF)
741   C1571_ROM("cpu_vc1540")
742   ROM_REGION (0x2000, "gfx1", ROMREGION_ERASEFF)
743   ROM_REGION (0x100, "gfx2", ROMREGION_ERASEFF)
744ROM_END
745
746// submitted as cost reduced set!
747ROM_START (c128dita)
748   ROM_REGION (0x132800, "main", 0)
749   ROM_LOAD ("318022.02", 0x100000, 0x8000, CRC(af1ae1e8) SHA1(953dcdf5784a6b39ef84dd6fd968c7a03d8d6816))
750
751    // in a cost reduced set this should be 1 rom
752   ROM_LOAD ("251913.01", 0x108000, 0x4000, CRC(0010ec31))
753//  ROM_LOAD ("901226.01", 0x108000, 0x2000, CRC(f833d117))
754//  ROM_LOAD( "kern128d.ita", 0x10a000, 0x2000, CRC(f1098d37 ))
755   ROM_LOAD ("318079.01", 0x10c000, 0x4000, CRC(66673e8b))
756
757    ROM_LOAD ("325167.01", 0x120000, 0x2000, CRC(bad36b88)) // taken from funet
758    // normally 1 rom
759//    ROM_LOAD ("325167.01b", 0x120000, 0x1000, CRC(ec4272ee)) //standard c64 901226.01
760//    ROM_LOAD ("325167.01b", 0x121000, 0x1000, CRC(2bc73556)) // bad dump
761
762   ROM_REGION (0x10000, "m8502", ROMREGION_ERASEFF)
763    // not included in submission
764//  C1571_ROM("cpu_vc1540")
765   ROM_REGION (0x2000, "gfx1", ROMREGION_ERASEFF)
766   ROM_REGION (0x100, "gfx2", ROMREGION_ERASEFF)
767ROM_END
768
769ROM_START (c128ger)
770    /* c128d german */
771   ROM_REGION (0x132800, "main", 0)
772   ROM_LOAD ("318022.02", 0x100000, 0x8000, CRC(af1ae1e8) SHA1(953dcdf5784a6b39ef84dd6fd968c7a03d8d6816))
773   ROM_LOAD ("318077.01", 0x108000, 0x8000, CRC(eb6e2c8f) SHA1(6b3d891fedabb5335f388a5d2a71378472ea60f4))
774   ROM_LOAD ("315079.01", 0x120000, 0x2000, CRC(fe5a2db1) SHA1(638f8aff51c2ac4f99a55b12c4f8c985ef4bebd3))
775   ROM_REGION (0x10000, "m8502", ROMREGION_ERASEFF)
776   ROM_REGION (0x2000, "gfx1", ROMREGION_ERASEFF)
777   ROM_REGION (0x100, "gfx2", ROMREGION_ERASEFF)
778ROM_END
779
780ROM_START (c128fra)
781   ROM_REGION (0x132800, "main", 0)
782   ROM_LOAD ("318018.04", 0x100000, 0x4000, CRC(9f9c355b) SHA1(d53a7884404f7d18ebd60dd3080c8f8d71067441))
783   ROM_LOAD ("318019.04", 0x104000, 0x4000, CRC(6e2c91a7) SHA1(c4fb4a714e48a7bf6c28659de0302183a0e0d6c0))
784   ROM_LOAD ("251913.01", 0x108000, 0x4000, CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88))
785#if 1
786   ROM_LOAD ("french.bin", 0x10c000, 0x4000, CRC(2df282b8) SHA1(a0680d04db3232fa9f58598e5c9f09c4fe94f601))
787#else
788   ROM_LOAD ("editor.french.bin", 0x10c000, 0x1000, CRC(3e086a24))
789   ROM_LOAD ("z80bios.bin", 0x10d000, 0x1000, CRC(c38d83c6))
790   ROM_LOAD ("kernalpart.french.bin", 0x10e000, 0x2000, CRC(ca5e1179))
791#endif
792   ROM_LOAD ("325167.01", 0x120000, 0x2000, CRC(bad36b88) SHA1(9119b27a1bf885fa4c76fff5d858c74c194dd2b8))
793   ROM_REGION (0x10000, "m8502", ROMREGION_ERASEFF)
794   ROM_REGION (0x2000, "gfx1", ROMREGION_ERASEFF)
795   ROM_REGION (0x100, "gfx2", ROMREGION_ERASEFF)
796ROM_END
797
798ROM_START (c128ita)
799   ROM_REGION (0x132800, "main", 0)
800   /* original 318022-01 */
801   ROM_LOAD ("318018.04", 0x100000, 0x4000, CRC(9f9c355b) SHA1(d53a7884404f7d18ebd60dd3080c8f8d71067441))
802   ROM_LOAD ("318019.04", 0x104000, 0x4000, CRC(6e2c91a7) SHA1(c4fb4a714e48a7bf6c28659de0302183a0e0d6c0))
803   ROM_LOAD ("251913.01", 0x108000, 0x4000, CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88))
804   ROM_LOAD ("italian.bin", 0x10c000, 0x4000, CRC(74d6b084) SHA1(592a626eb2b5372596ac374d3505c3ce78dd040f))
805   ROM_LOAD ("325167.01", 0x120000, 0x2000, CRC(bad36b88) SHA1(9119b27a1bf885fa4c76fff5d858c74c194dd2b8))
806   ROM_REGION (0x10000, "m8502", ROMREGION_ERASEFF)
807   ROM_REGION (0x2000, "gfx1", ROMREGION_ERASEFF)
808   ROM_REGION (0x100, "gfx2", ROMREGION_ERASEFF)
809ROM_END
810
811ROM_START (c128swe)
812   ROM_REGION (0x132800, "main", 0)
813   ROM_LOAD ("318022.02", 0x100000, 0x8000, CRC(af1ae1e8) SHA1(953dcdf5784a6b39ef84dd6fd968c7a03d8d6816))
814   ROM_LOAD ("318034.01", 0x108000, 0x8000, CRC(cb4e1719) SHA1(9b0a0cef56d00035c611e07170f051ee5e63aa3a))
815   ROM_LOAD ("325181.01", 0x120000, 0x2000, CRC(7a70d9b8) SHA1(aca3f7321ee7e6152f1f0afad646ae41964de4fb))
816   ROM_REGION (0x10000, "m8502", ROMREGION_ERASEFF)
817   ROM_REGION (0x2000, "gfx1", ROMREGION_ERASEFF)
818   ROM_REGION (0x100, "gfx2", ROMREGION_ERASEFF)
819ROM_END
820
821ROM_START (c128nor)
822   ROM_REGION (0x132800, "main", 0)
823   ROM_LOAD ("318018.04", 0x100000, 0x4000, BAD_DUMP CRC(9f9c355b) SHA1(d53a7884404f7d18ebd60dd3080c8f8d71067441))
824   ROM_LOAD ("318019.04", 0x104000, 0x4000, BAD_DUMP CRC(6e2c91a7) SHA1(c4fb4a714e48a7bf6c28659de0302183a0e0d6c0))
825   ROM_LOAD ("251913.01", 0x108000, 0x4000, BAD_DUMP CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88))
826   ROM_LOAD ("nor.bin", 0x10c000, 0x4000, BAD_DUMP CRC(a5406848) SHA1(00fe2fd610a812121befab1e7238fa882c0f8257))
827   /* standard c64, vic20 based norwegian */
828   ROM_LOAD ("char.nor", 0x120000, 0x2000, BAD_DUMP CRC(ba95c625) SHA1(5a87faa457979e7b6f434251a9e32f4483b337b3))
829   ROM_REGION (0x10000, "m8502", ROMREGION_ERASEFF)
830   ROM_REGION (0x2000, "gfx1", ROMREGION_ERASEFF)
831   ROM_REGION (0x100, "gfx2", ROMREGION_ERASEFF)
832ROM_END
833
834537static const sid6581_interface c128_sound_interface =
835538{
836539   c64_paddle_read
r3189r3190
838541
839542
840543
544/*************************************
545 *
546 *  Machine driver
547 *
548 *************************************/
549
550
841551static MACHINE_DRIVER_START( c128 )
842552   /* basic machine hardware */
843553   MDRV_CPU_ADD("main", Z80, VIC6567_CLOCK)
r3189r3190
903613   MDRV_SOUND_CONFIG(c128_sound_interface)
904614MACHINE_DRIVER_END
905615
616static MACHINE_DRIVER_START( c128dpal )
617   MDRV_IMPORT_FROM( c128pal )
618   MDRV_IMPORT_FROM( cpu_c1571 )
619MACHINE_DRIVER_END
906620
621
622
623/*************************************
624 *
625 *  ROM definition(s)
626 *
627 *************************************/
628
629
630ROM_START( c128 )
631   ROM_REGION( 0x132800, "main", 0 )
632   ROM_SYSTEM_BIOS( 0, "default", "rev. 1" )
633   ROMX_LOAD( "318018-04.bin", 0x100000, 0x4000, CRC(9f9c355b) SHA1(d53a7884404f7d18ebd60dd3080c8f8d71067441), ROM_BIOS(1) )         // BASIC lo
634   ROMX_LOAD( "318019-04.bin", 0x104000, 0x4000, CRC(6e2c91a7) SHA1(c4fb4a714e48a7bf6c28659de0302183a0e0d6c0), ROM_BIOS(1) )         // BASIC hi
635//   ROMX_LOAD( "251913-01.bin", 0x108000, 0x4000, CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88), ROM_BIOS(1) )         // C64 OS ROM
636   ROMX_LOAD( "318020-05.bin", 0x10c000, 0x4000, CRC(ba456b8e) SHA1(ceb6e1a1bf7e08eb9cbc651afa29e26adccf38ab), ROM_BIOS(1) )         // Kernal
637   ROM_SYSTEM_BIOS( 1, "rev0", "rev. 0" )
638   ROMX_LOAD( "318018-02.bin", 0x100000, 0x4000, CRC(2ee6e2fa) SHA1(60e1491e1d5782e3cf109f518eb73427609badc6), ROM_BIOS(2) )         // BASIC lo
639   ROMX_LOAD( "318019-02.bin", 0x104000, 0x4000, CRC(d551fce0) SHA1(4d223883e866645328f86a904b221464682edc4f), ROM_BIOS(2) )         // BASIC hi
640//   ROMX_LOAD( "251913-01.bin", 0x108000, 0x4000, CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88), ROM_BIOS(2) )         // C64 OS ROM
641   ROMX_LOAD( "318020-03.bin", 0x10c000, 0x4000, CRC(00456b8e) SHA1(ceb6e1a1bf7e08eb9cbc651afa29e26adccf38ab), ROM_BIOS(2) )         // Kernal
642
643   ROM_LOAD( "251913-01.bin", 0x108000, 0x4000, CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88) )      // C64 OS ROM
644   ROM_LOAD( "390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) )      // Character
645
646   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
647   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
648   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
649ROM_END
650
651
652ROM_START( c128cr )
653   ROM_REGION( 0x132800, "main", 0 )
654   ROM_LOAD( "252343-03.bin", 0x100000, 0x8000, CRC(009c355b) SHA1(d53a7884404f7d18ebd60dd3080c8f8d71067441) )         // BASIC lo + hi
655   ROM_LOAD( "252343-04.bin", 0x108000, 0x8000, CRC(002c91a7) SHA1(c4fb4a714e48a7bf6c28659de0302183a0e0d6c0) )         // C64 OS ROM + Kernal
656   ROM_LOAD( "390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) )         // Character
657
658   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
659   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
660   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
661ROM_END
662
663
664/* See notes at the top of the driver about PAL dumps */
665
666ROM_START( c128ger )
667   ROM_REGION( 0x132800, "main", 0 )
668   ROM_SYSTEM_BIOS( 0, "default", "rev. 1" )
669   ROMX_LOAD( "318018-04.bin", 0x100000, 0x4000, CRC(9f9c355b) SHA1(d53a7884404f7d18ebd60dd3080c8f8d71067441), ROM_BIOS(1) )         // BASIC lo
670   ROMX_LOAD( "318019-04.bin", 0x104000, 0x4000, CRC(6e2c91a7) SHA1(c4fb4a714e48a7bf6c28659de0302183a0e0d6c0), ROM_BIOS(1) )         // BASIC hi
671//   ROMX_LOAD( "251913-01.bin", 0x108000, 0x4000, CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88), ROM_BIOS(1) )         // C64 OS ROM
672   ROMX_LOAD( "315078-02.bin", 0x10c000, 0x4000, CRC(b275bb2e) SHA1(78ac5dcdd840b092ba1ee6d19b33af079613291f), ROM_BIOS(1) )         // Kernal
673   ROM_SYSTEM_BIOS( 1, "rev0", "rev. 0" )
674   ROMX_LOAD( "318018-02.bin", 0x100000, 0x4000, CRC(2ee6e2fa) SHA1(60e1491e1d5782e3cf109f518eb73427609badc6), ROM_BIOS(2) )         // BASIC lo
675   ROMX_LOAD( "318019-02.bin", 0x104000, 0x4000, CRC(d551fce0) SHA1(4d223883e866645328f86a904b221464682edc4f), ROM_BIOS(2) )         // BASIC hi
676//   ROMX_LOAD( "251913-01.bin", 0x108000, 0x4000, CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88), ROM_BIOS(2) )         // C64 OS ROM
677   ROMX_LOAD( "315078-01.bin", 0x10c000, 0x4000, CRC(a51e2168) SHA1(bcf82a89a8fc5d086bec2ff3bcbdecc8af2be3af), ROM_BIOS(2) )         // Kernal
678
679   ROM_LOAD( "251913-01.bin", 0x108000, 0x4000, CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88) )      // C64 OS ROM
680   ROM_LOAD( "390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) )      // Character
681
682   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
683   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
684   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
685ROM_END
686
687ROM_START( c128fin )
688   ROM_REGION( 0x132800, "main", 0 )
689   ROM_LOAD( "318018-04.bin", 0x100000, 0x4000, BAD_DUMP CRC(9f9c355b) SHA1(d53a7884404f7d18ebd60dd3080c8f8d71067441) )         // BASIC lo
690   ROM_LOAD( "318019-04.bin", 0x104000, 0x4000, BAD_DUMP CRC(6e2c91a7) SHA1(c4fb4a714e48a7bf6c28659de0302183a0e0d6c0) )         // BASIC hi
691   ROM_LOAD( "251913-01.bin", 0x108000, 0x4000, BAD_DUMP CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88) )         // C64 OS ROM
692   ROM_SYSTEM_BIOS( 0, "fin1", "set 1" )
693   ROMX_LOAD( "editor.finnish1.bin", 0x10c000, 0x1000, BAD_DUMP CRC(71002a97), ROM_BIOS(1) )
694//   ROMX_LOAD( "z80bios.bin", 0x10d000, 0x1000, CRC(c38d83c6), BAD_DUMP ROM_BIOS(1) )
695   ROMX_LOAD( "kernalpart.finnish1.bin", 0x10e000, 0x2000, BAD_DUMP CRC(167b8364), ROM_BIOS(1) )
696   ROM_SYSTEM_BIOS( 1, "fin2", "set 2" )
697   ROMX_LOAD( "editor.finnish2.bin", 0x10c000, 0x1000, BAD_DUMP CRC(b7ff5efe), ROM_BIOS(2) )
698//   ROMX_LOAD( "z80bios.bin", 0x10d000, 0x1000, BAD_DUMP CRC(c38d83c6), ROM_BIOS(2) )
699   ROMX_LOAD( "kernalpart.finnish2.bin", 0x10e000, 0x2000, BAD_DUMP CRC(7b0d2140), ROM_BIOS(2) )
700
701   ROM_LOAD( "z80bios.bin", 0x10d000, 0x1000, BAD_DUMP CRC(c38d83c6) )
702   /* Swedish character set while waiting for a real dump */
703   ROM_LOAD( "325181-01.bin", 0x120000, 0x2000, BAD_DUMP CRC(7a70d9b8) SHA1(aca3f7321ee7e6152f1f0afad646ae41964de4fb) )
704
705   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
706   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
707   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
708ROM_END
709
710ROM_START( c128fra )
711   ROM_REGION( 0x132800, "main", 0 )
712   ROM_LOAD( "318018-04.bin", 0x100000, 0x4000, BAD_DUMP CRC(9f9c355b) SHA1(d53a7884404f7d18ebd60dd3080c8f8d71067441) )         // BASIC lo
713   ROM_LOAD( "318019-04.bin", 0x104000, 0x4000, BAD_DUMP CRC(6e2c91a7) SHA1(c4fb4a714e48a7bf6c28659de0302183a0e0d6c0) )         // BASIC hi
714   ROM_LOAD( "251913-01.bin", 0x108000, 0x4000, BAD_DUMP CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88) )         // C64 OS ROM
715   ROM_LOAD( "editor.french.bin", 0x10c000, 0x1000, BAD_DUMP CRC(3e086a24) )
716   ROM_LOAD( "z80bios.bin", 0x10d000, 0x1000, BAD_DUMP CRC(c38d83c6) )
717   ROM_LOAD( "kernalpart.french.bin", 0x10e000, 0x2000, BAD_DUMP CRC(ca5e1179) )
718   ROM_LOAD( "characters.french.325167-01.bin", 0x120000, 0x2000, BAD_DUMP CRC(bad36b88) )
719
720   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
721   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
722   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
723ROM_END
724
725
726ROM_START( c128nor )
727   ROM_REGION( 0x132800, "main", 0 )
728   ROM_LOAD( "318018-04.bin", 0x100000, 0x4000, BAD_DUMP CRC(9f9c355b) SHA1(d53a7884404f7d18ebd60dd3080c8f8d71067441) )         // BASIC lo
729   ROM_LOAD( "318019-04.bin", 0x104000, 0x4000, BAD_DUMP CRC(6e2c91a7) SHA1(c4fb4a714e48a7bf6c28659de0302183a0e0d6c0) )         // BASIC hi
730   ROM_LOAD( "251913-01.bin", 0x108000, 0x4000, BAD_DUMP CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88) )         // C64 OS ROM
731   ROM_LOAD( "editor.norwegian.bin", 0x10c000, 0x1000, BAD_DUMP CRC(84c55911) )
732   ROM_LOAD( "z80bios.bin", 0x10d000, 0x1000, BAD_DUMP CRC(c38d83c6) )
733   ROM_LOAD( "kernalpart.norwegian.bin", 0x10e000, 0x2000, BAD_DUMP CRC(3ba48012) )
734   /* standard vic20 based norwegian */
735   ROM_LOAD( "char.nor", 0x120000, 0x2000, BAD_DUMP CRC(ba95c625) SHA1(5a87faa457979e7b6f434251a9e32f4483b337b3) )
736
737   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
738   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
739   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
740ROM_END
741
742
743/* C128D Board is basically the same as C128 + a second board for the disk drive */
744ROM_START( c128d )
745   ROM_REGION( 0x132800, "main", 0 )
746   ROM_LOAD( "318018-04.bin", 0x100000, 0x4000, CRC(9f9c355b) SHA1(d53a7884404f7d18ebd60dd3080c8f8d71067441) )         // BASIC lo
747   ROM_LOAD( "318019-04.bin", 0x104000, 0x4000, CRC(6e2c91a7) SHA1(c4fb4a714e48a7bf6c28659de0302183a0e0d6c0) )         // BASIC hi
748   ROM_LOAD( "251913-01.bin", 0x108000, 0x4000, CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88) )         // C64 OS ROM
749   ROM_LOAD( "318020-05.bin", 0x10c000, 0x4000, CRC(ba456b8e) SHA1(ceb6e1a1bf7e08eb9cbc651afa29e26adccf38ab) )         // Kernal
750   ROM_LOAD( "390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) )
751
752   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
753   C1571_ROM("cpu_vc1540")
754   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
755   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
756ROM_END
757
758#define rom_c128dpr      rom_c128d
759
760/* This BIOS is exactly the same as C128 rev. 1, but on two ROMs only */
761ROM_START( c128dcr )
762   ROM_REGION( 0x132800, "main", 0 )
763   ROM_LOAD( "318022-02.bin", 0x100000, 0x8000, CRC(af1ae1e8) SHA1(953dcdf5784a6b39ef84dd6fd968c7a03d8d6816) )         // BASIC lo + hi
764   ROM_LOAD( "318023-02.bin", 0x108000, 0x8000, CRC(eedc120a) SHA1(f98c5a986b532c78bb68df9ec6dbcf876913b99f) )         // C64 OS ROM + Kernal
765   ROM_LOAD( "390059-01.bin", 0x120000, 0x2000, CRC(6aaaafe6) SHA1(29ed066d513f2d5c09ff26d9166ba23c2afb2b3f) )         // Character
766
767   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
768   C1571_ROM("cpu_vc1540")
769   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
770   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
771ROM_END
772
773
774/* See notes at the top of the driver about PAL dumps */
775
776ROM_START( c128drde )
777   ROM_REGION( 0x132800, "main", 0 )
778   ROM_LOAD( "318022-02.bin", 0x100000, 0x8000, CRC(af1ae1e8) SHA1(953dcdf5784a6b39ef84dd6fd968c7a03d8d6816) )         // BASIC lo + hi
779   ROM_LOAD( "318077-01.bin", 0x108000, 0x8000, CRC(eb6e2c8f) SHA1(6b3d891fedabb5335f388a5d2a71378472ea60f4) )         // C64 OS ROM + Kernal Ger
780   ROM_LOAD( "315079-01.bin", 0x120000, 0x2000, CRC(fe5a2db1) SHA1(638f8aff51c2ac4f99a55b12c4f8c985ef4bebd3) )
781
782   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
783   C1571_ROM("cpu_vc1540")
784   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
785   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
786ROM_END
787
788
789ROM_START( c128drsw )
790   ROM_REGION( 0x132800, "main", 0 )
791   ROM_LOAD( "318022-02.bin", 0x100000, 0x8000, CRC(af1ae1e8) SHA1(953dcdf5784a6b39ef84dd6fd968c7a03d8d6816) )         // BASIC lo + hi
792   ROM_LOAD( "318034-01.bin", 0x108000, 0x8000, CRC(cb4e1719) SHA1(9b0a0cef56d00035c611e07170f051ee5e63aa3a) )         // C64 OS ROM + Kernal Sw/Fi
793   ROM_LOAD( "325181-01.bin", 0x120000, 0x2000, CRC(7a70d9b8) SHA1(aca3f7321ee7e6152f1f0afad646ae41964de4fb) )
794
795   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
796   C1571_ROM("cpu_vc1540")
797   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
798   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
799ROM_END
800
801
802ROM_START( c128drit )
803   ROM_REGION( 0x132800, "main", 0 )
804   ROM_LOAD( "318022-01.bin", 0x100000, 0x8000, CRC(e857df90) SHA1(953dcdf5784a6b39ef84dd6fd968c7a03d8d6816) )         // BASIC lo + hi - based on BASIC rev.0
805   ROM_LOAD( "251913-01.bin", 0x108000, 0x4000, BAD_DUMP CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88) )         // C64 OS ROM
806   ROM_LOAD( "editor.italian.bin", 0x10c000, 0x1000, BAD_DUMP CRC(8df58148) )
807   ROM_LOAD( "z80bios.bin", 0x10d000, 0x1000, BAD_DUMP CRC(c38d83c6) )
808   ROM_LOAD( "kernalpart.italian.bin", 0x10e000, 0x2000, BAD_DUMP CRC(7b0d2140) )
809   ROM_LOAD( "325167-01.bin", 0x120000, 0x2000, BAD_DUMP CRC(bad36b88) )
810
811   ROM_REGION( 0x10000, "m8502", ROMREGION_ERASEFF )
812   C1571_ROM("cpu_vc1540")
813   ROM_REGION( 0x2000, "gfx1", ROMREGION_ERASEFF )
814   ROM_REGION( 0x100, "gfx2", ROMREGION_ERASEFF )
815ROM_END
816
817
818
819/*************************************
820 *
821 *  System configuration(s)
822 *
823 *************************************/
824
825
907826static SYSTEM_CONFIG_START(c128)
908827   CONFIG_DEVICE(c64_cartslot_getinfo)
909828   CONFIG_DEVICE(cbmfloppy_device_getinfo)
r3189r3190
911830SYSTEM_CONFIG_END
912831
913832static SYSTEM_CONFIG_START(c128d)
833   CONFIG_DEVICE(c64_cartslot_getinfo)
914834   CONFIG_DEVICE(c1571_device_getinfo)
915835   CONFIG_DEVICE(datasette_device_getinfo)
916836SYSTEM_CONFIG_END
917837
918/*    YEAR  NAME        PARENT  COMPAT  MACHINE     INPUT       INIT        CONFIG  COMPANY   FULLNAME */
919COMP (1985, c128,      0,      0,      c128,      c128,      c128,      c128,   "Commodore Business Machines Co.","Commodore 128 NTSC", 0)
920COMP (1985, c128ger,   c128,   0,      c128pal,   c128ger,   c128pal,   c128,   "Commodore Business Machines Co.","Commodore 128 German (PAL)", 0)
921COMP (1985, c128fra,   c128,   0,      c128pal,   c128fra,   c128pal,   c128,   "Commodore Business Machines Co.","Commodore 128 French (PAL)", 0)
922COMP (1985, c128ita,   c128,   0,      c128pal,   c128ita,   c128pal,   c128,   "Commodore Business Machines Co.","Commodore 128 Italian (PAL)", 0)
923COMP (1985, c128swe,   c128,   0,      c128pal,   c128swe,   c128pal,   c128,   "Commodore Business Machines Co.","Commodore 128 Swedish (PAL)", 0)
924/* other countries spanish, belgium, norwegian */
925COMP (1985, c128nor,   c128,   0,      c128pal,   c128ita,   c128pal,   c128,   "Commodore Business Machines Co.","Commodore 128 Norwegian (PAL)", GAME_NOT_WORKING)
926COMP (1985, c128d,      c128,   0,      c128d,      c128,      c128,      c128d,   "Commodore Business Machines Co.","Commodore 128D NTSC", GAME_NOT_WORKING)
927//COMP(1985,c128dita,   c128,   0,      c128d,      c128,       c128,       c128d,  "Commodore Business Machines Co.","Commodore 128D Italian (PAL)", GAME_NOT_WORKING)
928COMP (1985, c128dita,   c128,   0,      c128pal,   c128ita,   c128pal,   c128d,   "Commodore Business Machines Co.","Commodore 128D Italian (PAL)", GAME_NOT_WORKING)
838
839/***************************************************************************
840
841  Game driver(s)
842
843***************************************************************************/
844
845/*    YEAR  NAME     PARENT COMPAT MACHINE   INPUT    INIT      CONFIG COMPANY                             FULLNAME            FLAGS */
846
847COMP( 1985, c128,      0,     0,   c128,     c128,    c128,     c128,  "Commodore Business Machines Co.", "Commodore 128 NTSC", 0)
848COMP( 1985, c128cr,    c128,  0,   c128,     c128,    c128,     c128,  "Commodore Business Machines Co.", "Commodore 128CR (NTSC, proto?)", 0)
849
850COMP( 1985, c128fin,   c128,  0,   c128pal,  c128swe, c128pal,  c128,  "Commodore Business Machines Co.", "Commodore 128 (PAL, Finland)", 0)
851COMP( 1985, c128fra,   c128,  0,   c128pal,  c128fra, c128pal,  c128,  "Commodore Business Machines Co.", "Commodore 128 (PAL, France)", 0)
852COMP( 1985, c128ger,   c128,  0,   c128pal,  c128ger, c128pal,  c128,  "Commodore Business Machines Co.", "Commodore 128 (PAL, Germany)", 0)
853COMP( 1985, c128nor,   c128,  0,   c128pal,  c128ita, c128pal,  c128,  "Commodore Business Machines Co.", "Commodore 128 (PAL, Norway)", 0)
854/* other countries spain, belgium, ... */
855
856COMP( 1985, c128dpr,   c128,  0,   c128d,    c128,    c128,     c128d, "Commodore Business Machines Co.", "Commodore 128D (NTSC, proto)", GAME_NOT_WORKING)
857COMP( 1985, c128d,     c128,  0,   c128dpal, c128,    c128pal,  c128d, "Commodore Business Machines Co.", "Commodore 128D PAL", GAME_NOT_WORKING)
858
859COMP( 1986, c128dcr,   c128,  0,   c128d,    c128,    c128,     c128d, "Commodore Business Machines Co.", "Commodore 128DCR NTSC", GAME_NOT_WORKING)
860COMP( 1986, c128drde,  c128,  0,   c128dpal, c128ger, c128pal,  c128d, "Commodore Business Machines Co.", "Commodore 128DCR (PAL, Germany)", GAME_NOT_WORKING)
861COMP( 1986, c128drit,  c128,  0,   c128dpal, c128ita, c128pal,  c128d, "Commodore Business Machines Co.", "Commodore 128DCR (PAL, Italy)", GAME_NOT_WORKING)
862COMP( 1986, c128drsw,  c128,  0,   c128dpal, c128swe, c128pal,  c128d, "Commodore Business Machines Co.", "Commodore 128DCR (PAL, Sweden)", GAME_NOT_WORKING)
863//COMP( 1986, c128d81,   c128,  0,   c128d,    c128,    c128,     c128d, "Commodore Business Machines Co.", "Commodore "128D/81" NTSC", GAME_NOT_WORKING) // no floppy drive emulation makes this useless atm
src/mess/drivers/c16.c
r3189r3190
99***************************************************************************/
1010
1111/*
12------------------------------------
13c16 commodore c16/c116/c232/c264 (pal version)
14plus4   commodore plus4 (ntsc version)
15c364 commodore c364/v364 prototype (ntsc version)
16------------------------------------
17(beta version)
1812
19if the game runs to fast with the ntsc version, try the pal version!
20flickering affects in one video version, try the other video version
132008 - Driver Updates
14---------------------
2115
22c16(pal version, ntsc version?):
23 design like the vc20/c64
24 sequel to c64
25 other keyboardlayout,
26 worse soundchip,
27 more colors, but no sprites,
28 other tape and gameports plugs
29 16 kbyte ram
30 newer basic and kernal (ieee floppy support)
16(most of the informations are taken from http://www.zimmers.net/cbmpics/ )
3117
32c116(pal version, ntsc version?):
33 100% software compatible to c16
34 small and flat
35 gummi keys
3618
37232:
38 video system versions (?)
39 plus4 case
40 32 kbyte ram
41 userport?, acia6551 chip?
19[CBM systems which belong to this driver]
4220
43264:
44 video system versions (?)
45 plus4 case
46 64 kbyte ram
47 userport?, acia6551 chip?
21* Commodore 116 (1984, Europe only)
4822
49plus4(pal version, ntsc version?):
50 in emu ntsc version!
51 case like c116, but with normal keys
52 64 kbyte ram
53 userport
54 build in additional rom with programs
23  Entry level computer of the Commodore 264 family, it was marketed only
24in Europe. It was impressive for the small size of its case, but it didn't
25meet commercial success
5526
56c364 prototype:
57 video system versions (?)
58 like plus4, but with additional numeric keyblock
59 slightly modified kernel rom
60 build in speech hardware/rom
27CPU: MOS Technology 7501 (variable clock rate, with max 1.76 Mhz)
28RAM: 16 kilobytes (expandable to 64k internally)
29ROM: 32 kilobytes
30Video: MOS Technology 7360 "TED" (5 Video modes; Max. Resolution 320x200;
31   40 columns text; Palette of 16 colors in 8 shades, for 128 colors)
32Sound: MOS Technology 7360 "TED" (2 voice tone-generating sound capabilities)
33Ports: MOS 7360 (2 Joystick/Mouse ports; CBM Serial port; 'TED' port; "TV"
34   Port and switch; CBM Monitor port; Power and reset switches; Power
35   connector)
36Keyboard: QWERTY 62 key "membrane" (8 programmable function keys; 4 direction
37   cursor-pad)
6138
62state
63-----
64rasterline based video system
65 imperfect scrolling support (when 40 columns or 25 lines)
66 lightpen support missing?
67 should be enough for 95% of the games and programs
68imperfect sound
69keyboard, joystick 1 and 2
70no speech hardware (c364)
71simple tape support
72serial bus
73 simple disk drives
74 no printer or other devices
75expansion modules
76 rom cartridges
77 simple ieee488 floppy support (c1551 floppy disk drive)
78 no other expansion modules
79no userport (plus4)
80 no rs232/v.24 interface
81quickloader
8239
83some unsolved problems
84 memory check by c16 kernel will not recognize more memory without restart of mess
85 cpu clock switching/changing (overclocking should it be)
40* Commodore 16 (1984)
8641
87Keys
88----
89Some PC-Keyboards does not behave well when special two or more keys are
90pressed at the same time
91(with my keyboard printscreen clears the pressed pause key!)
42  Redesigned version of the C116, with a different case and a different
43keyboard.
9244
93shift-cbm switches between upper-only and normal character set
94(when wrong characters on screen this can help)
95run (shift-stop) loads first program from device 8 (dload"*) and starts it
96stop-reset activates monitor (use x to leave it)
45CPU: MOS Technology 7501 (variable clock rate, with max 1.76 Mhz)
46RAM: 16 kilobytes (expandable to 64k internally)
47ROM: 32 kilobytes
48Video: MOS Technology 7360 "TED" (5 Video modes; Max. Resolution 320x200;
49   40 columns text; Palette of 16 colors in 8 shades, for 128 colors)
50Sound: MOS Technology 7360 "TED" (2 voice tone-generating sound capabilities)
51Ports: MOS 7360 (2 Joystick/Mouse ports; CBM Serial port; 'TED' port; "TV"
52   Port and switch; CBM Monitor port; Power and reset switches; Power
53   connector)
54Keyboard: QWERTY 66 key typewriter style (8 programmable function keys;
55   4 direction cursor-pad)
9756
98Tape
99----
100(DAC 1 volume in noise volume)
101loading of wav, prg and prg files in zip archiv
102commandline -cassette image
103wav:
104 8 or 16(not tested) bit, mono, 5000 Hz minimum
105 has the same problems like an original tape drive (tone head must
106 be adjusted to get working(no load error,...) wav-files)
107zip:
108 must be placed in current directory
109 prg's are played in the order of the files in zip file
11057
111use LOAD or LOAD"" or LOAD"",1 for loading of normal programs
112use LOAD"",1,1 for loading programs to their special address
58* Commodore Plus/4 (1984)
11359
114several programs relies on more features
115(loading other file types, writing, ...)
60  This system became the middle tier of the Commodore 264 family, replacing
61the original Commodore 264. The Plus/4 is basically the same as the C264,
62but the name refers to the four built-in programs which came with the
63machine: Word Processing, Spreadsheet, Database software, Graphing package.
11664
117Discs
118-----
119only file load from drive 8 and 9 implemented
120 loads file from rom directory (*.prg,*p00) (must NOT be specified on commandline)
121 or file from d64 image (here also directory LOAD"$",8 supported)
122use DLOAD"filename"
123or LOAD"filename",8
124or LOAD"filename",8,1 (for loading machine language programs at their address)
125for loading
126type RUN or the appropriate sys call to start them
65CPU: MOS Technology 7501 (variable clock rate, with max 1.76 Mhz)
66RAM: 64 kilobytes (expandable to 64k internally)
67ROM: 64 kilobytes
68Video: MOS Technology 7360 "TED" (5 Video modes; Max. Resolution 320x200;
69   40 columns text; Palette of 16 colors in 8 shades, for 128 colors)
70Sound: MOS Technology 7360 "TED" (2 voice tone-generating sound capabilities)
71Ports: MOS 7360 (2 Joystick/Mouse ports; CBM Serial port; 'TED' port; "TV"
72   Port and switch; CBM Monitor port; Power and reset switches; Power
73   connector)
74Keyboard: Full-sized QWERTY 67 key (8 programmable function keys;
75   4 direction cursor-pad)
12776
128several programs rely on more features
129(loading other file types, writing, ...)
13077
131most games rely on starting own programs in the floppy drive
132(and therefore cpu level emulation is needed)
78* Commodore 232 (1984, Prototype)
13379
134Roms
135----
136.bin .rom .lo .hi .prg
137files with boot-sign in it
138  recogniced as roms
80  This system never reached the production and only few units exist. It is
81in between the C16 and the C264, with its 32 kilobytes of RAM.
13982
140.prg files loaded at address in its first two bytes
141.bin, .rom, .lo , .hi roms loaded to cs1 low, cs1 high, cs2 low, cs2 high
142 address accordingly to order in command line
14383
144Quickloader
145-----------
146.prg files supported
147loads program into memory and sets program end pointer
148(works with most programs)
149program ready to get started with RUN
150loads first rom when you press quickload key (f8)
84* Commodore 264 (1984, Prototype)
15185
152when problems start with -log and look into error.log file
153 */
86  Basically the same of a Plus/4 but without the built-in programs.
15487
15588
89* Commodore V364 (1984, Prototype)
90
91  This system was supposed to become the high-end system of the family,
92featuring 64 kilobytes of RAM, the same technology of the Plus/4, a
93keyboard with numeric keypad and built in voice synthesis capabilities.
94
95[TO DO]
96
97* Floppy drives:
98
99- Drives 8 & 9 supported, but limited compatibility. Real disk emulation is
100needed.
101
102* Other Peripherals:
103
104- Lightpen support is unfinished
105- Missing support for (it might or might not be added eventually):
106printers and other devices; most expansion modules; userport; rs232/v.24 interface.
107
108* System Specific
109
110- V364 lacks speech hardware emulation
111
112*/
113
114
156115#include "driver.h"
157116#include "sound/sid6581.h"
158117
r3189r3190
164123
165124#include "includes/c16.h"
166125
126/*************************************
127 *
128 *  Main CPU memory handlers
129 *
130 *************************************/
167131
132
133
168134/*
169135 * commodore c16/c116/plus 4
170136 * 16 KByte (C16/C116) or 32 KByte or 64 KByte (plus4) RAM
r3189r3190
404370#endif
405371
406372
373/*************************************
374 *
375 *  Graphics definitions
376 *
377 *************************************/
407378
408/* Initialise the c16 palette */
379
409380static PALETTE_INIT( c16 )
410381{
411382   int i;
r3189r3190
415386   }
416387}
417388
418#if 0
419/* cbm version in kernel at 0xff80 (offset 0x3f80)
420   0x80 means pal version */
421389
422    /* basic */
423    ROM_LOAD ("318006.01", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd))
424390
425    /* kernal pal */
426    ROM_LOAD("318004.05",    0x14000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb))
427    ROM_LOAD ("318004.03", 0x14000, 0x4000, CRC(77bab934))
428391
429    /* kernal ntsc */
430    ROM_LOAD ("318005.05", 0x14000, 0x4000, CRC(70295038) SHA1(a3d9e5be091b98de39a046ab167fb7632d053682))
431    ROM_LOAD ("318005.04", 0x14000, 0x4000, CRC(799a633d))
392/*************************************
393 *
394 *  Machine driver
395 *
396 *************************************/
432397
433    /* 3plus1 program */
434    ROM_LOAD ("317053.01", 0x18000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f))
435    ROM_LOAD ("317054.01", 0x1c000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693))
436398
437    /* same as 109de2fc, but saved from running machine, so
438        io area different ! */
439    ROM_LOAD ("3plus1hi.rom", 0x1c000, 0x4000, CRC(aab61387))
440    /* same but lo and hi in one rom */
441    ROM_LOAD ("3plus1.rom", 0x18000, 0x8000, CRC(7d464449))
442#endif
443
444ROM_START (c232)
445    ROM_REGION (0x40000, "main", 0)
446    ROM_LOAD ("318006.01", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd))
447    ROM_LOAD("318004.01",    0x14000, 0x4000, CRC(dbdc3319) SHA1(3c77caf72914c1c0a0875b3a7f6935cd30c54201))
448ROM_END
449
450ROM_START (c16)
451    ROM_REGION (0x40000, "main", 0)
452    ROM_LOAD ("318006.01", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd))
453    ROM_LOAD("318004.05",    0x14000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb))
454ROM_END
455
456ROM_START (c16hun)
457    ROM_REGION (0x40000, "main", 0)
458    ROM_LOAD ("318006.01", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd))
459    ROM_LOAD("hungary.bin",    0x14000, 0x4000, CRC(775f60c5) SHA1(20cf3c4bf6c54ef09799af41887218933f2e27ee))
460ROM_END
461
462ROM_START (c16c)
463    ROM_REGION (0x40000, "main", 0)
464    ROM_LOAD ("318006.01", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd))
465    ROM_LOAD("318004.05",    0x14000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb))
466    C1551_ROM ("cpu_c1551")
467ROM_END
468
469ROM_START (c16v)
470    ROM_REGION (0x40000, "main", 0)
471    ROM_LOAD ("318006.01", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd))
472    ROM_LOAD("318004.05",    0x14000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb))
473    VC1541_ROM ("cpu_vc1540")
474ROM_END
475
476ROM_START (plus4)
477    ROM_REGION (0x40000, "main", 0)
478    ROM_LOAD ("318006.01", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd))
479    ROM_LOAD ("318005.05", 0x14000, 0x4000, CRC(70295038) SHA1(a3d9e5be091b98de39a046ab167fb7632d053682))
480    ROM_LOAD ("317053.01", 0x18000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f))
481    ROM_LOAD ("317054.01", 0x1c000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693))
482ROM_END
483
484ROM_START (plus4c)
485    ROM_REGION (0x40000, "main", 0)
486    ROM_LOAD ("318006.01", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd))
487    ROM_LOAD ("318005.05", 0x14000, 0x4000, CRC(70295038) SHA1(a3d9e5be091b98de39a046ab167fb7632d053682))
488    ROM_LOAD ("317053.01", 0x18000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f))
489    ROM_LOAD ("317054.01", 0x1c000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693))
490    C1551_ROM ("cpu_c1551")
491ROM_END
492
493ROM_START (plus4v)
494    ROM_REGION (0x40000, "main", 0)
495    ROM_LOAD ("318006.01", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd))
496    ROM_LOAD ("318005.05", 0x14000, 0x4000, CRC(70295038) SHA1(a3d9e5be091b98de39a046ab167fb7632d053682))
497    ROM_LOAD ("317053.01", 0x18000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f))
498    ROM_LOAD ("317054.01", 0x1c000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693))
499    VC1541_ROM ("cpu_vc1540")
500ROM_END
501
502ROM_START (c364)
503    ROM_REGION (0x40000, "main", 0)
504    ROM_LOAD ("318006.01", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd))
505    ROM_LOAD ("kern364p.bin", 0x14000, 0x4000, CRC(84fd4f7a) SHA1(b9a5b5dacd57ca117ef0b3af29e91998bf4d7e5f))
506    ROM_LOAD ("317053.01", 0x18000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f))
507    ROM_LOAD ("317054.01", 0x1c000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693))
508    /* at address 0x20000 not so good */
509    ROM_LOAD ("spk3cc4.bin", 0x28000, 0x4000, CRC(5227c2ee) SHA1(59af401cbb2194f689898271c6e8aafa28a7af11))
510ROM_END
511
512
513
514399static MACHINE_DRIVER_START( c16 )
515400   /* basic machine hardware */
516401   MDRV_CPU_ADD("main", M7501, 1400000)        /* 7.8336 Mhz */
r3189r3190
615500   MDRV_CPU_PROGRAM_MAP(c364_map, 0)
616501MACHINE_DRIVER_END
617502
618static DRIVER_INIT( c16 )      { c16_driver_init(machine); }
619#ifdef UNUSED_FUNCTION
620DRIVER_INIT( c16hun )   { c16_driver_init(machine); }
621DRIVER_INIT( c16c )      { c16_driver_init(machine); }
622DRIVER_INIT( c16v )      { c16_driver_init(machine); }
623#endif
624static DRIVER_INIT( plus4 )   { c16_driver_init(machine); }
625#ifdef UNUSED_FUNCTION
626DRIVER_INIT( plus4c )   { c16_driver_init(machine); }
627DRIVER_INIT( plus4v )   { c16_driver_init(machine); }
628DRIVER_INIT( c364 )      { c16_driver_init(machine); }
629#endif
630503
631504
505
506/*************************************
507 *
508 *  ROM definition(s)
509 *
510 *************************************/
511
512ROM_START( c232 )
513   ROM_REGION (0x40000, "main", 0)
514   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
515   ROM_LOAD( "318004-01.bin", 0x14000, 0x4000, CRC(dbdc3319) SHA1(3c77caf72914c1c0a0875b3a7f6935cd30c54201) )
516ROM_END
517
518ROM_START( c264 )
519   ROM_REGION (0x40000, "main", 0)
520   ROM_LOAD( "basic-264.bin", 0x10000, 0x4000, CRC(6a2fc8e3) SHA1(473fce23afa07000cdca899fbcffd6961b36a8a0) )
521   ROM_LOAD( "kernal-264.bin", 0x14000, 0x4000, CRC(8f32abe7) SHA1(d481faf5fcbb331878dc7851c642d04f26a32873) )
522ROM_END
523
524ROM_START( c364 )
525   ROM_REGION (0x40000, "main", 0)
526   ROM_LOAD( "318006.01", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
527   ROM_LOAD( "kern364p.bin", 0x14000, 0x4000, CRC(84fd4f7a) SHA1(b9a5b5dacd57ca117ef0b3af29e91998bf4d7e5f) )
528   ROM_LOAD( "317053-01.bin", 0x18000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f) )
529   ROM_LOAD( "317054-01.bin", 0x1c000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693) )
530   /* at address 0x20000 not so good */
531   ROM_LOAD( "spk3cc4.bin", 0x28000, 0x4000, CRC(5227c2ee) SHA1(59af401cbb2194f689898271c6e8aafa28a7af11) )
532ROM_END
533
534
535ROM_START( c16 )
536   ROM_REGION (0x40000, "main", 0)
537   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
538   ROM_SYSTEM_BIOS( 0, "default", "rev. 5" )
539   ROMX_LOAD( "318004-05.bin", 0x14000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb), ROM_BIOS(1) )
540   ROM_SYSTEM_BIOS( 1, "rev3", "rev. 3" )
541   ROMX_LOAD( "318004-03.bin", 0x14000, 0x4000, CRC(77bab934) SHA1(97814dab9d757fe5a3a61d357a9a81da588a9783), ROM_BIOS(2) )
542   ROM_SYSTEM_BIOS( 2, "rev4", "rev. 4" )
543   ROMX_LOAD( "318004-04.bin", 0x14000, 0x4000, CRC(be54ed79) SHA1(514ad3c29d01a2c0a3b143d9c1d4143b1912b793), ROM_BIOS(3) )
544ROM_END
545
546ROM_START( c16c )
547   ROM_REGION (0x40000, "main", 0)
548   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
549   ROM_SYSTEM_BIOS( 0, "default", "rev. 5" )
550   ROMX_LOAD( "318004-05.bin", 0x14000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb), ROM_BIOS(1) )
551   ROM_SYSTEM_BIOS( 1, "rev3", "rev. 3" )
552   ROMX_LOAD( "318004-03.bin", 0x14000, 0x4000, CRC(77bab934) SHA1(97814dab9d757fe5a3a61d357a9a81da588a9783), ROM_BIOS(2) )
553   ROM_SYSTEM_BIOS( 2, "rev4", "rev. 4" )
554   ROMX_LOAD( "318004-04.bin", 0x14000, 0x4000, CRC(be54ed79) SHA1(514ad3c29d01a2c0a3b143d9c1d4143b1912b793), ROM_BIOS(3) )
555
556   C1551_ROM ("cpu_c1551")
557ROM_END
558
559ROM_START( c16v )
560   ROM_REGION (0x40000, "main", 0)
561   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
562   ROM_SYSTEM_BIOS( 0, "default", "rev. 5" )
563   ROMX_LOAD( "318004-05.bin", 0x14000, 0x4000, CRC(71c07bd4) SHA1(7c7e07f016391174a557e790c4ef1cbe33512cdb), ROM_BIOS(1) )
564   ROM_SYSTEM_BIOS( 1, "rev3", "rev. 3" )
565   ROMX_LOAD( "318004-03.bin", 0x14000, 0x4000, CRC(77bab934) SHA1(97814dab9d757fe5a3a61d357a9a81da588a9783), ROM_BIOS(2) )
566   ROM_SYSTEM_BIOS( 2, "rev4", "rev. 4" )
567   ROMX_LOAD( "318004-04.bin", 0x14000, 0x4000, CRC(be54ed79) SHA1(514ad3c29d01a2c0a3b143d9c1d4143b1912b793), ROM_BIOS(3) )
568
569   VC1541_ROM ("cpu_vc1540")
570ROM_END
571
572#define rom_c116      rom_c16
573#define rom_c116c      rom_c16c
574#define rom_c116v      rom_c16v
575
576ROM_START( c16hun )
577   ROM_REGION (0x40000, "main", 0)
578   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
579   ROM_LOAD( "hungary.bin", 0x14000, 0x4000, CRC(775f60c5) SHA1(20cf3c4bf6c54ef09799af41887218933f2e27ee) )
580ROM_END
581
582ROM_START( plus4 )
583   ROM_REGION (0x40000, "main", 0)
584   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
585   ROM_SYSTEM_BIOS( 0, "default", "rev. 5" )
586   ROMX_LOAD( "318005-05.bin", 0x14000, 0x4000, CRC(70295038) SHA1(a3d9e5be091b98de39a046ab167fb7632d053682), ROM_BIOS(1) )
587   ROM_SYSTEM_BIOS( 1, "rev4", "rev. 4" )
588   ROMX_LOAD( "318005-04.bin", 0x14000, 0x4000, CRC(799a633d) SHA1(5df52c693387c0e2b5d682613a3b5a65477311cf), ROM_BIOS(2) )
589
590   ROM_LOAD( "317053-01.bin", 0x18000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f) )
591   ROM_LOAD( "317054-01.bin", 0x1c000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693) )
592ROM_END
593
594ROM_START( plus4c )
595   ROM_REGION (0x40000, "main", 0)
596   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
597   ROM_SYSTEM_BIOS( 0, "default", "rev. 5" )
598   ROMX_LOAD( "318005-05.bin", 0x14000, 0x4000, CRC(70295038) SHA1(a3d9e5be091b98de39a046ab167fb7632d053682), ROM_BIOS(1) )
599   ROM_SYSTEM_BIOS( 1, "rev4", "rev. 4" )
600   ROMX_LOAD( "318005-04.bin", 0x14000, 0x4000, CRC(799a633d) SHA1(5df52c693387c0e2b5d682613a3b5a65477311cf), ROM_BIOS(2) )
601
602   ROM_LOAD( "317053-01.bin", 0x18000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f) )
603   ROM_LOAD( "317054-01.bin", 0x1c000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693) )
604
605   C1551_ROM ("cpu_c1551")
606ROM_END
607
608ROM_START( plus4v )
609   ROM_REGION (0x40000, "main", 0)
610   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
611   ROM_SYSTEM_BIOS( 0, "default", "rev. 5" )
612   ROMX_LOAD( "318005-05.bin", 0x14000, 0x4000, CRC(70295038) SHA1(a3d9e5be091b98de39a046ab167fb7632d053682), ROM_BIOS(1) )
613   ROM_SYSTEM_BIOS( 1, "rev4", "rev. 4" )
614   ROMX_LOAD( "318005-04.bin", 0x14000, 0x4000, CRC(799a633d) SHA1(5df52c693387c0e2b5d682613a3b5a65477311cf), ROM_BIOS(2) )
615
616   ROM_LOAD( "317053-01.bin", 0x18000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f) )
617   ROM_LOAD( "317054-01.bin", 0x1c000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693) )
618
619   VC1541_ROM ("cpu_vc1540")
620ROM_END
621
622
623
624/*************************************
625 *
626 *  Generic driver initialization
627 *
628 *************************************/
629
630
631static DRIVER_INIT( c16 )
632{
633   c16_driver_init(machine);
634}
635
636static DRIVER_INIT( plus4 )   
637{
638   c16_driver_init(machine);
639}
640
641
642/*************************************
643 *
644 *  System configuration(s)
645 *
646 *************************************/
647
648
632649static SYSTEM_CONFIG_START(c16)
633650   CONFIG_DEVICE(c16_cartslot_getinfo)
634651   CONFIG_DEVICE(cbmfloppy_device_getinfo)
r3189r3190
677694   CONFIG_RAM_DEFAULT(64 * 1024)
678695SYSTEM_CONFIG_END
679696
680/*      YEAR    NAME    PARENT  COMPAT  MACHINE INPUT   INIT    CONFIG   COMPANY                                FULLNAME */
681COMP ( 1984,   c232,   c16,   0,   c16,   c16,   c16,   c16,     "Commodore Business Machines Co.",      "Commodore 232 Prototype", 0)
682COMP ( 1984,   c16,   0,   0,   c16,   c16,   c16,   c16,     "Commodore Business Machines Co.",      "Commodore 16/116/232/264 (PAL)", 0)
683COMP ( 1984,   c16hun, c16,   0,   c16,   c16,   c16,   c16,     "Commodore Business Machines Co.",      "Commodore 16 Novotrade (PAL, Hungarian Character Set)", 0)
684COMP ( 1984,   c16c,   c16,   0,   c16c,   c16c,   c16,   c16c,    "Commodore Business Machines Co.",      "Commodore 16/116/232/264 (PAL), 1551", 0 )
685COMP ( 1984,   plus4,   c16,   0,   plus4,   plus4,   plus4,   plus,    "Commodore Business Machines Co.",      "Commodore +4 (NTSC)", 0)
686COMP ( 1984,   plus4c, c16,   0,   plus4c, plus4c, plus4,   plusc,   "Commodore Business Machines Co.",      "Commodore +4 (NTSC), 1551", 0 )
687COMP ( 1984,   c364,   c16,   0,   c364,   plus4,   plus4,   plusv,   "Commodore Business Machines Co.",      "Commodore 364 (Prototype)", GAME_IMPERFECT_SOUND)
688COMP ( 1984,   c16v,   c16,   0,   c16v,   c16v,   c16,   c16v,    "Commodore Business Machines Co.",      "Commodore 16/116/232/264 (PAL), VC1541", GAME_NOT_WORKING)
689COMP ( 1984,   plus4v, c16,   0,   plus4v, plus4v, plus4,   plusv,   "Commodore Business Machines Co.",      "Commodore +4 (NTSC), VC1541", GAME_NOT_WORKING)
697/***************************************************************************
698
699  Game driver(s)
700
701***************************************************************************/
702
703/*    YEAR  NAME  PARENT COMPAT MACHINE INPUT   INIT   CONFIG    COMPANY                             FULLNAME            FLAGS */
704
705COMP( 1984, c16,     0,     0,  c16,    c16,    c16,    c16,     "Commodore Business Machines Co.",  "Commodore 16 (PAL)", 0)
706COMP( 1984, c16c,    c16,   0,  c16c,   c16c,   c16,    c16c,    "Commodore Business Machines Co.",  "Commodore 16 (PAL, 1551)", 0 )
707COMP( 1984, c16v,    c16,   0,  c16v,   c16v,   c16,    c16v,    "Commodore Business Machines Co.",  "Commodore 16 (PAL, VC1541)", GAME_NOT_WORKING)
708COMP( 1984, c16hun,  c16,   0,  c16,    c16,    c16,    c16,     "Commodore Business Machines Co.",  "Commodore 16 Novotrade (PAL, Hungary)", 0)
709
710COMP( 1984, c116,    c16,   0,  c16,    c16,    c16,    c16,     "Commodore Business Machines Co.",  "Commodore 116 (PAL)", 0)
711COMP( 1984, c116c,    c16,   0,  c16c,   c16c,   c16,    c16c,    "Commodore Business Machines Co.",  "Commodore 116 (PAL, 1551)", 0 )
712COMP( 1984, c116v,   c16,   0,  c16v,   c16v,   c16,    c16v,    "Commodore Business Machines Co.",  "Commodore 116 (PAL, VC1541)", GAME_NOT_WORKING)
713
714COMP( 1984, plus4,   c16,   0,  plus4,  plus4,  plus4,  plus,    "Commodore Business Machines Co.",  "Commodore Plus/4 (NTSC)", 0)
715COMP( 1984, plus4c,  c16,   0,  plus4c, plus4c, plus4,  plusc,   "Commodore Business Machines Co.",  "Commodore Plus/4 (NTSC, 1551)", 0 )
716COMP( 1984, plus4v,  c16,   0,  plus4v, plus4v, plus4,  plusv,   "Commodore Business Machines Co.",  "Commodore Plus/4 (NTSC, VC1541)", GAME_NOT_WORKING)
717
718COMP( 1984, c232,    c16,   0,  c16,    c16,    c16,    c16,     "Commodore Business Machines Co.",  "Commodore 232 (Prototype)", 0)
719COMP( 1984, c264,    c16,   0,  c16,    plus4,  plus4,  plus,    "Commodore Business Machines Co.",  "Commodore 264 (Prototype)", 0)
720COMP( 1984, c364,    c16,   0,  c364,   plus4,  plus4,  plusv,   "Commodore Business Machines Co.",  "Commodore V364 (Prototype)", GAME_IMPERFECT_SOUND)
src/mess/drivers/vc20.c
r3189r3190
1010***************************************************************************/
1111
1212/*
13------------------------------------
14vic20 commodore vic20 (ntsc version)
15vc20  commodore vc20  (pal version)
16------------------------------------
1713
18vic20 ntsc-version
19 when screen is two wide right or low,
20  or screen doesn't fitt in visible area
21  or gameplay is too fast
22 try the pal version
142008 - Driver Updates
15---------------------
2316
24vc20 pal-version
17(most of the informations are taken from http://www.zimmers.net/cbmpics/ )
2518
26a normal or good written program does not rely on the video system
2719
28vic20cr
29 cost reduced
30 only modified for cheaper production (newer rams, ...)
31 (2 2kx8 rams instead of 8 1kx4 rams, ...)
20[CBM systems which belong to this driver]
3221
33State
34-----
3522
36rasterline based video system
37 should be enough for all vic20 games and programs
38imperfect sound
39timer system only 98% accurate
40simple tape support
41serial bus
42 simple disk support
43 no printer or other devices
44no userport
45 no rs232/v.24 interface
46keyboard
47gameport
48 joystick
49 paddles
50 lightpen
51expansion slot
52 ram and rom cartridges
53 no special expansion modules like ieee488 interface
54Quickloader
23* VIC-1001 (1981, Japan)
5524
56for a more complete vic20 emulation take a look at the very good
57vice emulator
25  The first model released was the Japanese one. It featured support for the
26Japanese katakana character.
5827
59Video
60-----
61NTSC:
62Screen Size (normal TV (horizontal),4/3 ratio)
63pixel ratio: about 7/5 !
64so no standard Vesa Resolution is good
65tweaked mode 256x256 acceptable
66best define own display mode (when graphic driver supports this)
67PAL:
68pixel ratio about 13/10 !
69good (but only part of screen filled) 1024x768
70acceptable 800x600
71better define own display mode (when graphic driver supports this)
28CPU: MOS Technology 6502 (1.01 Mhz)
29RAM: 5 kilobytes (Expanded to 21k though an external 16k unit)
30ROM: 20 kilobytes
31Video: MOS Technology 6560 "VIC"(Text: 22 columns, 23 rows; Hires: 176x184
32pixels bitmapped; 8 text colors, 16 background colors)
33Sound: MOS Technology 6560 "VIC" (3 voices -square wave-, noise and volume)
34Ports: 6522 VIA x2 (1 Joystick/Mouse port; CBM Serial port; 'Cartridge /
35   Game / Expansion' port; CBM Monitor port; CBM 'USER' port; Power and
36   reset switches; Power connector)
37Keyboard: Full-sized QWERTY 66 key (8 programmable function keys; 2 sets of
38   Keyboardable graphic characters; 2 key direction cursor-pad)
39 
7240
73XMESS:
74use -scalewidth 3 -scaleheight 2 for acceptable display
75better define own display mode
41* VIC 20 (1981)
7642
77Keys
78----
79Some PC-Keyboards does not behave well when special two or more keys are
80pressed at the same time
81(with my keyboard printscreen clears the pressed pause key!)
43  This system was the first computer to sell more than one million units
44worldwide. It was sold both in Europe and in the US. In Germany the
45computer was renamed as VC 20 (apparently, it stands for 'VolksComputer'
8246
83stop-restore in much cases prompt will appear
84shift-cbm switches between upper-only and normal character set
85(when wrong characters on screen this can help)
86run (shift-stop) load and start program from tape
47CPU: MOS Technology 6502A (1.01 Mhz)
48RAM: 5 kilobytes (Expanded to 32k)
49ROM: 20 kilobytes
50Video: MOS Technology 6560 "VIC"(Text: 22 columns, 23 rows; Hires: 176x184
51pixels bitmapped; 8 text colors, 16 background colors)
52Sound: MOS Technology 6560 "VIC" (3 voices -square wave-, noise and volume)
53Ports: 6522 VIA x2 (1 Joystick/Mouse port; CBM Serial port; 'Cartridge /
54   Game / Expansion' port; CBM Monitor port; CBM 'USER' port; Power and
55   reset switches; Power connector)
56Keyboard: Full-sized QWERTY 66 key (8 programmable function keys; 2 sets of
57   Keyboardable graphic characters; 2 key direction cursor-pad)
8758
88Lightpen
89--------
90Paddle 3 x-axe
91Paddle 4 y-axe
9259
93Tape
94----
95(DAC 1 volume in noise volume)
96loading of wav, prg and prg files in zip archiv
97commandline -cassette image
98wav:
99 8 or 16(not tested) bit, mono, 12500 Hz minimum
100 has the same problems like an original tape drive (tone head must
101 be adjusted to get working (no load error,...) wav-files)
102zip:
103 must be placed in current directory
104 prg's are played in the order of the files in zip file
60* VIC 21 (1983)
10561
106use LOAD or LOAD"" or LOAD"",1 for loading of normal programs
107use LOAD"",1,1 for loading programs to their special address
62  It consists of a VIC 20 with built-in RAM expansion, to reach a RAM
63  capability of 21 kilobytes.
10864
109several programs rely on more features
110(loading other file types, writing, ...)
11165
112Discs
113-----
114only file load from drive 8 and 9 implemented
115 loads file from rom directory (*.prg,*.p00)(must NOT be specified on commandline)
116 or file from d64 image (here also directory command LOAD"$",8 supported)
117LOAD"filename",8
118or LOAD"filename",8,1 (for loading machine language programs at their address)
119for loading
120type RUN or the appropriate SYS call to start them
66* VIC 20CR
12167
122several programs rely on more features
123(loading other file types, writing, ...)
68  CR stands for Cost Reduced, as it consisted of a board with only 2 (larger)
69block of RAM instead of 8.
12470
125some games rely on starting own programs in the floppy drive
126(and therefore CPU level emulation is needed)
12771
128Roms
129----
130.bin .rom .a0 .20 .40 .60 .prg
131files with boot-sign in it
132  recognized as roms
72[TO DO]
13373
134.20 files loaded at 0x2000
135.40 files loaded at 0x4000
136.60 files loaded at 0x6000
137.a0 files loaded at 0xa000
138.prg files loaded at address in its first two bytes
139.bin .rom files loaded at 0x4000 when 0x4000 bytes long
140else loaded at 0xa000
14174
142Quickloader
143-----------
144.prg files supported
145loads program into memory and sets program end pointer
146(works with most programs)
147program ready to get started with RUN
148currently loads first rom when you press quickload key (f8)
75* Imperfect sound
14976
150when problems start with -log and look into error.log file
151 */
77* Timer system only 98% accurate
15278
79* No support for printer or other devices; no userport; no rs232/v.24
80interface; no special expansion modules like ieee488 interface
81 
82*/
15383
84
15485#include "driver.h"
15586
15687#include "includes/cbm.h"
r3189r3190
16394#include "includes/vc20.h"
16495
16596
97/*************************************
98 *
99 *  Main CPU memory handlers
100 *
101 *************************************/
102
103
166104static ADDRESS_MAP_START( vc20_mem , ADDRESS_SPACE_PROGRAM, 8)
167105   AM_RANGE(0x0000, 0x03ff) AM_RAM
168106   AM_RANGE(0x0400, 0x0fff) AM_ROMBANK(1) AM_WRITE( vc20_0400_w )   /* ram, rom or nothing */
r3189r3190
308246INPUT_PORTS_END
309247
310248
249/*************************************
250 *
251 *  Graphics definitions
252 *
253 *************************************/
311254
312/* Initialise the vc20 palette */
255
313256static PALETTE_INIT( vc20 )
314257{
315258   int i;
r3189r3190
319262   }
320263}
321264
322#if 0
323   /* chargen */
324   ROM_LOAD ("901460.03", 0x8000, 0x1000, CRC(83e032a6))
325   /* basic */
326   ROM_LOAD ("901486.01", 0xc000, 0x2000, CRC(db4c43c1))
327   /* kernel ntsc-m of vic1001? */
328   ROM_LOAD ("901486.02", 0xe000, 0x2000, CRC(336900d7))
329   /* kernel ntsc */
330   ROM_LOAD ("901486.06", 0xe000, 0x2000, CRC(e5e7c174))
331   /* kernel pal */
332   ROM_LOAD ("901486.07", 0xe000, 0x2000, CRC(4be07cb4))
333265
334   /* patched pal system for swedish/finish keyboard and chars */
335   /* but in rom? (maybe patched means in this case nec version) */
336   ROM_LOAD ("nec22101.207", 0x8000, 0x1000, CRC(d808551d))
337   ROM_LOAD ("nec22081.206", 0xe000, 0x2000, CRC(b2a60662))
338266
339   /* ieee488 cartridge */
340   ROM_LOAD ("325329-04.bin", 0xb000, 0x800, CRC(d37b6335))
341#endif
267/*************************************
268 *
269 *  Machine driver
270 *
271 *************************************/
342272
343ROM_START (vic20)
344   ROM_REGION (0x10000, "main",0)
345   ROM_FILL( 0x0000, 0x8000, 0xFF )
346   ROM_LOAD ("901460.03", 0x8000, 0x1000, CRC(83e032a6) SHA1(4fd85ab6647ee2ac7ba40f729323f2472d35b9b4))
347   ROM_FILL( 0x9000, 0x3000, 0xFF )
348   ROM_LOAD ("901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d))
349   ROM_LOAD ("901486.06", 0xe000, 0x2000, CRC(e5e7c174) SHA1(06de7ec017a5e78bd6746d89c2ecebb646efeb19))
350ROM_END
351
352ROM_START (vic1001)
353   ROM_REGION (0x10000, "main",0)
354   ROM_FILL( 0x0000, 0x8000, 0xFF )
355   ROM_LOAD ("901460.02", 0x8000, 0x1000, CRC(fcfd8a4b) SHA1(dae61ac03065aa2904af5c123ce821855898c555))
356   ROM_FILL( 0x9000, 0x3000, 0xFF )
357   ROM_LOAD ("901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d))
358   ROM_LOAD ("901486.02", 0xe000, 0x2000, CRC(336900d7) SHA1(c9ead45e6674d1042ca6199160e8583c23aeac22))
359ROM_END
360
361ROM_START (vic20swe)
362   ROM_REGION (0x10000, "main",0)
363   ROM_FILL( 0x0000, 0x8000, 0xFF )
364   ROM_LOAD ("nec22101.207", 0x8000, 0x1000, CRC(d808551d) SHA1(f403f0b0ce5922bd61bbd768bdd6f0b38e648c9f))
365   ROM_FILL( 0x9000, 0x3000, 0xFF )
366   ROM_LOAD ("901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d))
367   ROM_LOAD ("nec22081.206", 0xe000, 0x2000, CRC(b2a60662) SHA1(cb3e2f6e661ea7f567977751846ce9ad524651a3))
368ROM_END
369
370ROM_START (vic20v)
371   ROM_REGION (0x10000, "main",0)
372   ROM_FILL( 0x0000, 0x8000, 0xFF )
373   ROM_LOAD ("901460.03", 0x8000, 0x1000, CRC(83e032a6) SHA1(4fd85ab6647ee2ac7ba40f729323f2472d35b9b4))
374   ROM_FILL( 0x9000, 0x3000, 0xFF )
375   ROM_LOAD ("901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d))
376   ROM_LOAD ("901486.06", 0xe000, 0x2000, CRC(e5e7c174) SHA1(06de7ec017a5e78bd6746d89c2ecebb646efeb19))
377   VC1540_ROM ("cpu_vc1540")
378ROM_END
379
380ROM_START (vic20i)
381   ROM_REGION (0x10000, "main",0)
382   ROM_FILL( 0x0000, 0x8000, 0xFF )
383   ROM_LOAD ("901460.03", 0x8000, 0x1000, CRC(83e032a6) SHA1(4fd85ab6647ee2ac7ba40f729323f2472d35b9b4))
384   ROM_FILL( 0x9000, 0x2000, 0xFF )
385   ROM_LOAD ("325329.04", 0xb000, 0x800, CRC(d37b6335) SHA1(828c965829d21c60e8c2d083caee045c639a270f))
386   ROM_LOAD ("901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d))
387   ROM_LOAD ("901486.06", 0xe000, 0x2000, CRC(e5e7c174) SHA1(06de7ec017a5e78bd6746d89c2ecebb646efeb19))
388/*   C2031_ROM ("cpu_vc1540") */
389ROM_END
390
391ROM_START (vc20)
392   ROM_REGION (0x10000, "main",0)
393   ROM_FILL( 0x0000, 0x8000, 0xFF )
394   ROM_LOAD ("901460.03", 0x8000, 0x1000, CRC(83e032a6) SHA1(4fd85ab6647ee2ac7ba40f729323f2472d35b9b4))
395   ROM_FILL( 0x9000, 0x3000, 0xFF )
396   ROM_LOAD ("901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d))
397   ROM_LOAD ("901486.07", 0xe000, 0x2000, CRC(4be07cb4) SHA1(ce0137ed69f003a299f43538fa9eee27898e621e))
398ROM_END
399
400ROM_START (vc20v)
401   ROM_REGION (0x10000, "main",0)
402   ROM_FILL( 0x0000, 0x8000, 0xFF )
403   ROM_LOAD ("901460.03", 0x8000, 0x1000, CRC(83e032a6) SHA1(4fd85ab6647ee2ac7ba40f729323f2472d35b9b4))
404   ROM_FILL( 0x9000, 0x3000, 0xFF )
405   ROM_LOAD ("901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d))
406   ROM_LOAD ("901486.07", 0xe000, 0x2000, CRC(4be07cb4) SHA1(ce0137ed69f003a299f43538fa9eee27898e621e))
407   VC1541_ROM ("cpu_vc1540")
408ROM_END
409
410273static MACHINE_DRIVER_START( vic20 )
411274   /* basic machine hardware */
412275   MDRV_CPU_ADD("main", M6502, VIC6560_CLOCK)        /* 7.8336 Mhz */
r3189r3190
492355MACHINE_DRIVER_END
493356
494357
358/*************************************
359 *
360 *  ROM definition(s)
361 *
362 *************************************/
363
364
365ROM_START( vic1001 )
366   ROM_REGION (0x10000, "main", 0 )
367   ROM_FILL( 0x0000, 0x8000, 0xff )
368   ROM_LOAD( "901460.02", 0x8000, 0x1000, CRC(fcfd8a4b) SHA1(dae61ac03065aa2904af5c123ce821855898c555) )
369   ROM_FILL( 0x9000, 0x3000, 0xff )
370   ROM_LOAD( "901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d) )
371   ROM_LOAD( "901486.02", 0xe000, 0x2000, CRC(336900d7) SHA1(c9ead45e6674d1042ca6199160e8583c23aeac22) )
372ROM_END
373
374
375ROM_START( vic20 )
376   ROM_REGION (0x10000, "main", 0 )
377   ROM_FILL( 0x0000, 0x8000, 0xff )
378   ROM_LOAD( "901460.03", 0x8000, 0x1000, CRC(83e032a6) SHA1(4fd85ab6647ee2ac7ba40f729323f2472d35b9b4) )
379   ROM_FILL( 0x9000, 0x3000, 0xff )
380   ROM_LOAD( "901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d) )
381   ROM_LOAD( "901486.06", 0xe000, 0x2000, CRC(e5e7c174) SHA1(06de7ec017a5e78bd6746d89c2ecebb646efeb19) )
382ROM_END
383
384ROM_START( vic20pal )
385   ROM_REGION (0x10000, "main", 0 )
386   ROM_FILL( 0x0000, 0x8000, 0xff )
387   ROM_LOAD( "901460.03", 0x8000, 0x1000, CRC(83e032a6) SHA1(4fd85ab6647ee2ac7ba40f729323f2472d35b9b4) )
388   ROM_FILL( 0x9000, 0x3000, 0xff )
389   ROM_LOAD( "901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d) )
390   ROM_LOAD( "901486.07", 0xe000, 0x2000, CRC(4be07cb4) SHA1(ce0137ed69f003a299f43538fa9eee27898e621e) )
391ROM_END
392
393#define rom_vic20cr      rom_vic20
394#define rom_vic20crp   rom_vic20pal
395
396#define rom_vc20      rom_vic20pal
397
398ROM_START( vic20swe )
399   /* patched pal system for swedish/finish keyboard and chars */
400   /* but in rom? (maybe patched means in this case nec version) */
401   ROM_REGION (0x10000, "main", 0 )
402   ROM_FILL( 0x0000, 0x8000, 0xff )
403   ROM_LOAD( "nec22101.207", 0x8000, 0x1000, CRC(d808551d) SHA1(f403f0b0ce5922bd61bbd768bdd6f0b38e648c9f) )
404   ROM_FILL( 0x9000, 0x3000, 0xff )
405   ROM_LOAD( "901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d) )
406   ROM_LOAD( "nec22081.206", 0xe000, 0x2000, CRC(b2a60662) SHA1(cb3e2f6e661ea7f567977751846ce9ad524651a3) )
407ROM_END
408
409
410ROM_START( vic20i )
411   ROM_REGION (0x10000, "main", 0 )
412   ROM_FILL( 0x0000, 0x8000, 0xff )
413   ROM_LOAD( "901460.03", 0x8000, 0x1000, CRC(83e032a6) SHA1(4fd85ab6647ee2ac7ba40f729323f2472d35b9b4) )
414   ROM_FILL( 0x9000, 0x2000, 0xff )
415   ROM_LOAD( "325329.04", 0xb000, 0x800, CRC(d37b6335) SHA1(828c965829d21c60e8c2d083caee045c639a270f) )
416   ROM_LOAD( "901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d) )
417   ROM_LOAD( "901486.06", 0xe000, 0x2000, CRC(e5e7c174) SHA1(06de7ec017a5e78bd6746d89c2ecebb646efeb19) )
418
419/*   C2031_ROM ("cpu_vc1540") */
420ROM_END
421
422ROM_START( vic20v )
423   ROM_REGION (0x10000, "main", 0 )
424   ROM_FILL( 0x0000, 0x8000, 0xff )
425   ROM_LOAD( "901460.03", 0x8000, 0x1000, CRC(83e032a6) SHA1(4fd85ab6647ee2ac7ba40f729323f2472d35b9b4) )
426   ROM_FILL( 0x9000, 0x3000, 0xff )
427   ROM_LOAD( "901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d) )
428   ROM_LOAD( "901486.06", 0xe000, 0x2000, CRC(e5e7c174) SHA1(06de7ec017a5e78bd6746d89c2ecebb646efeb19) )
429
430   VC1540_ROM ("cpu_vc1540")
431ROM_END
432
433ROM_START( vic20plv )
434   ROM_REGION (0x10000, "main", 0 )
435   ROM_FILL( 0x0000, 0x8000, 0xff )
436   ROM_LOAD( "901460.03", 0x8000, 0x1000, CRC(83e032a6) SHA1(4fd85ab6647ee2ac7ba40f729323f2472d35b9b4) )
437   ROM_FILL( 0x9000, 0x3000, 0xff )
438   ROM_LOAD( "901486.01", 0xc000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d) )
439   ROM_LOAD( "901486.07", 0xe000, 0x2000, CRC(4be07cb4) SHA1(ce0137ed69f003a299f43538fa9eee27898e621e) )
440
441   VC1541_ROM("cpu_vc1540")
442ROM_END
443
444#define rom_vc20v      rom_vic20plv
445
446
447/*************************************
448 *
449 *  System configuration(s)
450 *
451 *************************************/
452
453
495454static SYSTEM_CONFIG_START(vic20)
496455   CONFIG_DEVICE(vic20_cartslot_getinfo)
497456   CONFIG_DEVICE(cbmfloppy_device_getinfo)
r3189r3190
514473   CONFIG_RAM(32 * 1024)
515474SYSTEM_CONFIG_END
516475
517/*      YEAR    NAME        PARENT  COMPAT  MACHINE INPUT       INIT    CONFIG     COMPANY                          FULLNAME */
518COMP ( 1981,   vic20,      0,      0,      vic20,   vic20,      vic20,   vic20,      "Commodore Business Machines Co.",  "VIC20 (NTSC)", GAME_IMPERFECT_SOUND)
519COMP ( 1981,   vic20i,    vic20,   0,      vic20i, vic20i,    vic20i, vic20,      "Commodore Business Machines Co.",  "VIC20 (NTSC), IEEE488 Interface (SYS45065)",   GAME_IMPERFECT_SOUND)
520COMP ( 1981,   vic1001,   vic20,   0,      vic20,   vic1001,   vic20,   vic20,      "Commodore Business Machines Co.",  "VIC1001 (NTSC)", GAME_IMPERFECT_SOUND)
521COMP ( 1981,   vc20,      vic20,   0,      vc20,   vc20,      vc20,   vic20,      "Commodore Business Machines Co.",  "VIC20/VC20(German) PAL",       GAME_IMPERFECT_SOUND)
522COMP ( 1981,   vic20swe,   vic20,   0,      vc20,   vic20swe,   vc20,   vic20,      "Commodore Business Machines Co.",  "VIC20 PAL, Swedish Expansion Kit", GAME_IMPERFECT_SOUND)
523COMP ( 1981,   vic20v,    vic20,   0,      vic20v, vic20,      vic20,   vic20v,     "Commodore Business Machines Co.",  "VIC20 (NTSC), VC1540", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
524COMP ( 1981,   vc20v,      vic20,   0,      vc20v,   vic20,      vc20,   vic20v,     "Commodore Business Machines Co.",  "VC20 (PAL), VC1541", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
476
477/***************************************************************************
478
479  Game driver(s)
480
481***************************************************************************/
482
483/*    YEAR  NAME      PARENT COMPAT MACHINE INPUT    INIT     CONFIG     COMPANY                             FULLNAME            FLAGS */
484
485COMP( 1981, vic1001,   vic20,  0,  vic20,   vic1001,  vic20,  vic20,     "Commodore Business Machines Co.",  "VIC-1001 (NTSC, Japan)", GAME_IMPERFECT_SOUND)
486
487COMP( 1981, vic20,     0,      0,   vic20,  vic20,    vic20,  vic20,     "Commodore Business Machines Co.",  "VIC 20 (NTSC)", GAME_IMPERFECT_SOUND)
488COMP( 1981, vic20cr,   vic20,  0,   vic20,  vic20,    vic20,  vic20,     "Commodore Business Machines Co.",  "VIC 20CR (NTSC)", GAME_IMPERFECT_SOUND)
489COMP( 1981, vic20i,    vic20,  0,   vic20i, vic20i,   vic20i, vic20,     "Commodore Business Machines Co.",  "VIC 20 (NTSC, IEEE488 Interface - SYS45065)", GAME_IMPERFECT_SOUND)
490COMP( 1981, vic20v,    vic20,  0,   vic20v, vic20,    vic20,  vic20v,    "Commodore Business Machines Co.",  "VIC 20 (NTSC, VC1540)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
491
492COMP( 1981, vic20pal,  vic20,  0,   vc20,   vc20,     vc20,   vic20,     "Commodore Business Machines Co.",  "VC 20 (PAL)", GAME_IMPERFECT_SOUND)
493COMP( 1981, vic20crp,  vic20,  0,   vc20,   vc20,     vc20,   vic20,     "Commodore Business Machines Co.",  "VC 20CR (PAL)", GAME_IMPERFECT_SOUND)
494COMP( 1981, vic20plv,  vic20,  0,   vc20v,  vic20,    vc20,   vic20v,    "Commodore Business Machines Co.",  "VC 20 (PAL, VC1541)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
495COMP( 1981, vc20,      vic20,  0,   vc20,   vc20,     vc20,   vic20,     "Commodore Business Machines Co.",  "VIC 20 (PAL, Germany)", GAME_IMPERFECT_SOUND)
496COMP( 1981, vc20v,     vic20,  0,   vc20v,  vic20,    vc20,   vic20v,    "Commodore Business Machines Co.",  "VIC 20 (PAL, Germany, VC1541)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
497
498COMP( 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
r3189r3190
88***************************************************************************/
99
1010/*
11------------------------------------
12max     commodore max (vic10/ultimax/vickie prototype)
13c64     commodore c64 (ntsc version)
14c64pal  commodore c64 (pal version)
15c64gs   commodore c64 game system (ntsc version)
16sx64    commodore sx64 (pal version)
17------------------------------------
18(preliminary version)
1911
20if the game runs to fast with the ntsc version, try the pal version!
122008 - Driver Updates
13---------------------
2114
22c64
23 design like the vic20
24 better videochip with sprites
25 famous sid6581 sound chip
26 64 kbyte ram
27 2nd gameport
28Educator 64-1
29 standard c64
30 bios color bios (as in pet64 series) when delivered with green monitor
31max  (vic10,ultimax,vickey prototype)
32 delivered in japan only?
33 (all modules should work with c64)
34 cartridges neccessary
35 low cost c64
36 flat design
37 only 4 kbyte sram
38 simplier banking chip
39  no portlines from cpu
40 only 1 cia6526 chip
41  restore key connection?
42  no serial bus
43  no userport
44 keyboard
45 tape port
46 2 gameports
47  lightpen (port a only) and joystick mentioned in advertisement
48  paddles
49 cartridge/expansion port (some signals different to c64)
50 no rom on board (minibasic with kernel delivered as cartridge?)
51c64gs
52 game console without keyboard
53 standard c64 mainboard!
54 modified kernal
55 basic rom
56 2. cia yes
57 no userport
58 no cbm serial port
59 no keyboard connector
60 no tapeport
61cbm4064/pet64/educator64-2
62 build in green monitor
63 other case
64 differences, versions???
65(sx100 sx64 like prototype with build in black/white monitor)
66sx64
67 movable compact (and heavy) all in one comp
68 build in vc1541
69 build in small color monitor
70 no tape connector
71dx64 prototype
72 two build in vc1541 (or 2 drives driven by one vc1541 circuit)
15(most of the informations are taken from http://www.zimmers.net/cbmpics/ )
7316
74state
75-----
76rasterline based video system
77 no cpu holding
78 imperfect scrolling support (when 40 columns or 25 lines)
79 lightpen support not finished
80 rasterline not finished
81no sound
82cia6526's look in machine/cia6526.c
83keyboard
84gameport a
85 paddles 1,2
86 joystick 1
87 2 button joystick/mouse joystick emulation
88 no mouse
89 lightpen (not finished)
90gameport b
91 paddles 3,4
92 joystick 2
93 2 button joystick/mouse joystick emulation
94 no mouse
95simple tape support
96 (not working, cia timing?)
97serial bus
98 simple disk drives
99 no printer or other devices
100expansion modules c64
101 rom cartridges (exrom)
102 ultimax rom cartridges (game)
103 no other rom cartridges (bankswitching logic in it, switching exrom, game)
104 no ieee488 support
105 no cpm cartridge
106 no speech cartridge (no circuit diagram found)
107 no fm sound cartridge
108 no other expansion modules
109expansion modules ultimax
110 ultimax rom cartridges
111 no other expansion modules
112no userport
113 no rs232/v.24 interface
114no super cpu modification
115no second sid modification
116quickloader
11717
118Keys
119----
120Some PC-Keyboards does not behave well when special two or more keys are
121pressed at the same time
122(with my keyboard printscreen clears the pressed pause key!)
18[CBM systems which belong to this driver]
12319
124shift-cbm switches between upper-only and normal character set
125(when wrong characters on screen this can help)
126run (shift-stop) loads pogram from type and starts it
20* Commodore Max Machine (1982, Japan)
12721
128Lightpen
129--------
130Paddle 5 x-axe
131Paddle 6 y-axe
22  The Max Machine was produced by Commodore Japan and was released along
23with the C64 in Japan. Also known as "UltiMax" (in North America ads)
24or "VC-10 / VIC-10" (in some European advertising), it was designed to be a
25game console. It has no internal kernel and no BASIC, everything must be
26supplied by the cart. A Mini BASIC and a BASIC carts were produced (the
27latter with support for LOAD/SAVE commands as well). The character rom
28is not present either and its content was, again, in the cart. Max Machine
29carts can be run by both C64 and C128.
13230
133Tape
134----
135(DAC 1 volume in noise volume)
136loading of wav, prg and prg files in zip archiv
137commandline -cassette image
138wav:
139 8 or 16(not tested) bit, mono, 125000 Hz minimum
140 has the same problems like an original tape drive (tone head must
141 be adjusted to get working(no load error,...) wav-files)
142zip:
143 must be placed in current directory
144 prg's are played in the order of the files in zip file
31CPU: MOS Technology 6510 (1Mhz)
32RAM: 4 kilobytes (2 kilobytes?)
33ROM: none
34Video: MOS 6566 "VIC-II" (320 x 200 Hi-Resolution, 40 columns text, 16
35   colors)
36Sound: MOS 6581 "SID" (3 voice stereo synthesizer/digital sound
37   capabilities)
38Ports: 6526 CIA (Power switch; 2 Commodore "Joystick" ports; 'EXPANSION'
39   port; "TV" port; CBM Datasette port)
40Keyboard: Full-sized QWERTY "Contact-Pad"
14541
146use LOAD or LOAD"" or LOAD"",1 for loading of normal programs
147use LOAD"",1,1 for loading programs to their special address
14842
149several programs relies on more features
150(loading other file types, writing, ...)
43* Commodore 64 (1982)
15144
152Discs
153-----
154only file load from drive 8 and 9 implemented
155 loads file from rom directory (*.prg,*.p00,*.t64) (must NOT be specified on
156 commandline)
157 or file from d64 image (here also directory LOAD"$",8 supported)
158use LOAD"filename",8
159or LOAD"filename",8,1 (for loading machine language programs at their address)
160for loading
161type RUN or the appropriate sys call to start them
45  Released in August 1982 in the US and marketed as a lower end home
46computer, the C64 dominated the home computer market for a few years,
47outselling competitors like Apple computers, IBM PCs and TRS-80s.
48During the early stages of the project it was called VIC-40, but the
49named was changed in the end probably to fit the name scheme used at
50time for business product (letter + memory size: P128 & B256).
51It was also advertised as VC 64 in Germany, and as VIC 64S in Sweden
52(the latter came with a modified character set)
16253
163several programs rely on more features
164(loading other file types, writing, ...)
54CPU: CSG 6510 (1Mhz)
55RAM: 64 kilobytes
56ROM: 20 kilobytes
57Video: MOS 6569 "VIC-II" (320 x 200 Hi-Resolution, 40 columns text, 16
58   colors)
59Sound: MOS 6581 "SID" (3 voice stereo synthesizer/digital sound
60   capabilities)
61Ports: MOS 6526 CIA x2 (Power switch; 2 Commodore Joystick/Mouse ports;
62   CBM Serial port; CBM Datasette port; parallel programmable "User"
63   port; CBM Monitor port; C64 expansion port)
64Keyboard: Full-sized 62 key QWERTY (8 programmable function keys; 2
65   cursor keys, 2 directions each)
16566
166most games rely on starting own programs in the floppy drive
167(and therefor cpu level emulation is needed)
67BIOS:
68   kernal.901227-02.bin
69   basic.901226-01.bin
70   characters.901225-01.bin
16871
169Roms
170----
171.prg
172.crt
173.80 .90 .a0 .b0 .e0 .f0
174files with boot-sign in it
175  recogniced as roms
17672
177.prg files loaded at address in its first two bytes
178.?0 files to address specified in extension
179.crt roms to addresses in crt file
73* Commodore 64 (1982, Japan)
18074
181Quickloader
182-----------
183.prg, .p00 and .t64 files supported (.t64s must be standard single entry type
184 with a start address of $0801 - which covers most T64 files)
185loads program into memory and sets program end pointer
186(works with most programs)
187program ready to get started with RUN
188loads first rom when you press quickload key (f8)
75  Released in Japan at the same time as Max Machine, in the hope to repeat
76the success of the VIC-1001, this system was a flop. Technically it is the
77same as the C64, but it has native support for the Katakana character set.
18978
190when problems start with -log and look into error.log file
79Video: MOS 6569 "VIC-II" (320 x 200 Hi-Resolution, 40 columns text, 16
80   colors)
81Keyboard: Full-sized 62 key QWERTY (8 programmable function keys; 2
82   cursor keys, 2 directions each; Katakana characters accessible through
83   C= key)
84
85BIOS
86   kernal.906145-02.bin
87   basic.901226-01.bin
88   characters.906143-02.bin
89
90
91* PET 64 (1983)
92
93  Also known as CBM 4064, it was a C64 fitted in a PET case and with a PET
94monochrome screen. Exactly like the C64, it features a VIC-II video chip,
95a SID sound chip, 2 x CIA 6526, 64K of memory and BASIC 2.0. Being forced
96to display on a monochrome screen, color codes were removed from the front
97of number keys. The kernel itself was modified to output only white
98characters on a black background. A plate with BASIC commands and other hints
99was put above the keyboard.
100
101Video: MOS 6569 "VIC-II" (320 x 200 Hi-Resolution, 40 columns text, 16
102   colors, monochrome 14" monitor support)
103Sound: MOS 6581 "SID" (3 voice stereo synthesizer/digital sound
104   capabilities; Internal speaker)
105Keyboard: Full-sized 62 key QWERTY (8 programmable function keys; 2
106   cursor keys, 2 directions each; complete BASIC reference on keyboard
107   panel )
108
109BIOS
110   kernal.4064.901246-01.bin
111   basic.901226-01.bin
112   characters.901225-01.bin
113
114
115* Educator 64 (1983)
116
117 Basically the same as the PET 64, but it uses a standard C64 kernel,
118allowing  to 'explore' all shades of green the monitor was capable of. Also
119the BASIC plate is slightly different. There could have been an earlier
120version, already called Educator 64, which came with no monitor and in a
121C64 case.
122
123Keyboard: Full-sized 62 key QWERTY (8 programmable function keys; 2
124   cursor keys, 2 directions each; complete BASIC reference on keyboard
125   panel )
126
127BIOS
128   kernal.901227-02.bin
129   basic.901226-01.bin
130   characters.901225-01.bin
131
132
133* SX-64 Executive Computer (1984)
134
135  Portable color computer based on the C64 hardware. The unit is heavy, with
136its metal case, features a built-in disk driver (mostly 1541 compatible) and
137has a large handle to carry the computer around. The detachable keyboard can
138be used as protective front plate. The SX-64 had a 4" full color screen and a
139built-in speaker. The only differences between the C64 and the SX-64 are in
140the start up colors and in the SX-64 better support for the internal floppy
141drive. The tape drive support was removed in the portable system.
142
143CPU: MOS 6510 (1Mhz)
144RAM: 64 kilobytes (68 with the 1541)
145ROM: 20 kilobytes (36 with the 1541)
146Video: MOS 6569 "VIC-II" (320 x 200 Hi-Resolution, 40 columns text, 16
147   colors, 4" Full-color screen)
148Sound: MOS 6581 "SID" (3 voice stereo synthesizer/digital sound
149   capabilities; Internal MONO speaker)
150Ports: MOS 6526 CIA x2 (Power switch; 2 Commodore Joystick/Mouse ports;
151   CBM Serial port; CBM Datasette port; parallel programmable "User"
152   port; CBM Monitor port; C64 expansion port)
153Keyboard: Full-sized 62 key QWERTY (8 programmable function keys; 2
154   cursor keys, 2 directions each; detachable)
155Additional hardware: Commodore 1541 Disk Drive (5.25" 170K SS SD Floppy)
156
157BIOS:
158   kernal.sx.251104-04.bin
159   basic.901226-01.bin
160   characters.901225-01.bin
161
162
163* DX-64 (198?)
164
165  Rumored version of a SX-64 variant featuring two floppy drives. Not sure
166if it ever reached the prototype stage.
167
168
169* Commodore 64C (1986)
170
171  Redesigned version of the C64, released with slightly upgraded versions
172of chips and peripherals. It came often bundled with GEOS, GUI based OS
173by Berkeley Softworks (it was stored on floppy disks). It's also known as
174C64-II but the name doesn't seems to have ever been official (only used
175by magazines at early stage of ad & review). Another redesign, in a slightly
176larger case (closer to the original C64) is known as Commodore 64G, because
177mainly sold in Germany. Other repackaged versions followed, built around the
178same kernel and chips.
179
180CPU: CSG 8500 (1 Mhz; 6510 compatible)
181RAM: 64 kilobytes
182ROM: 20 kilobytes
183Video: MOS 8565 "VIC-II" (320 x 200 Hi-Resolution, 40 columns text, 16
184   colors)
185Sound: CSG 8580 "SID" (3 voice stereo synthesizer/digital sound
186   capabilities)
187Ports: MOS 6526 CIA x2 (Power switch; 2 Commodore Joystick/Mouse ports;
188   CBM Serial port; CBM Datasette port; parallel programmable "User"
189   port; CBM Monitor port; C64 expansion port)
190Keyboard: Full-sized 62 key QWERTY (8 programmable function keys; 2
191   cursor keys, 2 directions each)
192
193BIOS:
194   64c.251913-01.bin
195   characters.901225-01.bin
196
197
198* Commodore 64 Games System (1990)
199
200  Repackaged C64 with neither keyboard, nor ports. Basically, the
201system came far too late to enter the console market of the 90s.
202
203CPU: CSG 6510 (1 Mhz)
204RAM: 64 kilobytes
205ROM: 16 kilobytes
206Video: MOS 8565 "VIC-II" (320 x 200 Hi-Resolution, 40 columns text, 16
207   colors)
208Sound: CSG 8580 "SID" (3 voice stereo synthesizer/digital sound
209   capabilities)
210Ports: MOS 6526 CIA (Power switch; 2 Commodore Joystick/Mouse ports;
211   CBM Monitor port; C64 expansion port)
212
213BIOS:
214   64gs.390852-01.bin
215   characters.901225-01.bin
216
217* Commodore 64 "Gold" (1984, US - 1986, Germany)
218
219  Commemorative version released to celebrate the one millionth Commodore 64
220sold in the country. The whole case is golden colored. It is also reasonable
221to assume that the US version is based on the original C64, while the German
222version is based on the C64C.
223
224
225[Rumored / Unconfirmed]
226
227VC-10 - Ultimax with built-in (even if stripped down) BASIC 2.0
228SX-100 - Rumored SX-64 prototype with built-in b&w screen
229C64CGS - C64GS in a C64C-like case, sold in Ireland (?), with a keyboard (?)
230
231
232[Known Fake / Unofficial BIOS]
233
234Max Machine - These are BASIC V2.0 and kernel contained in the MAX BASIC
235cart, not a real Max BIOS. 
236   basic.901230-01.bin
237   kernal.901231-01.bin
238   
239Character roms
240   c64-german.bin - amateur hack
241   c64-hungarian.bin - amateur hack
242   kauno.bin - calligraphic font for the C64, data saved from a 1985 tape
243
244[Peripherals]
245
246- CBM 1530 Datasette Recorder
247- VIC 1541 / 1541-II / 1571 / 1581 disk drive (up to 5 at a time)
248- Commodore Modem Cartridge 1650 / 1660 / 1670
249- IEEE Interface Expansion Card
250- Commodore CBM 8050 / 4040 Dual Floppy Disk Drives (through IEEE Interface)
251- Commodore 6400 Letter Quality Printer (through IEEE Interface)
252- Commodore 8023 Dot Matrix Printer (through IEEE Interface)
253- Commodore 1520 Printer / Plotter
254- Commodore 1701 / 1702 Monitor
255
256- Lt. Kernal Hard Drive
257- CMD HD-Series
258
259- Commodore Joysticks
260- Commodore Paddles
261- Commodore 1350 / 1351 Mouse
262- CMD SmartMouse
263- Inkwell Light Pen
264- Koala Pad
265- Commodore Music Maker overlay
266- External music keyboard (to be plugged into the Sound Expander)
267
268- Commodore REU: REU stands for RAM Expansion Unit for C64 & C128. Three
269models 1700 (128 KB) and 1750 (512 KB), and later the 1764 (256 KB, for the
270C64)
271- Commodore Sound Expander Cart
272- Commodore Sound Sampler Cart
273- Berkeley Softworks GeoRAM
274- Schnedler Systems Turbo Master CPU
275- Creative Micro Designs (CMD) RAMDrive, RAMLink and Super CPU Accelerator
276- CMD SID symphony cartridge
277- Commodore Universal Btx Decoder: Same design of the REU, it's a decoder
278for the Bildschirmtext, a sort of videotext online service similar to the
279French Minitel. It allowed the C64 + Decoder to replace the very expensive
280standalone decoder.
281
282Freezer Carts: Datel "Action Replay", Freeze Frame MK III B, Trilogic
283"Expert", "The Final Cartridge III", "Retro Replay"
284Kernal Replacement: SpeedDOS, DolphinDOS, JiffyDOS etc.
285
286[TO DO]
287
288* Floppy drives:
289
290- Drives 8 & 9 supported, but limited compatibility. Real 1541 emulation is
291needed.
292
293* Cartridges:
294
295- Currently only Type 0 hardware is supported (check cart code in
296machine/c64.c for more notes). Other Types may load but not work.
297
298* Datasette:
299
300- Currently, .t64 images are supported as Quickload device. This only works
301if the file contains a single entry with a start address of $0801. This
302covers most of the existing files, but the format is desinged to be much
303more flexible and it could be implemented as a real tape format.
304
305* Other Peripherals:
306
307- Lightpen support is unfinished
308- Missing support for (it might or might not be added eventually):
309printers; IEEE488; CPM cartridge, Speech cartridge, FM Sound cartridge
310and other expansion modules; userport; rs232/v.24 interface; Super CPU;
311dual SID configuration
312
313* Informations / BIOS / Supported Sets:
314
315- Find out if C64 was sold both as VIC 64S and C64 in Sweden, and which
316were inner/outer differences. For sure advertising was using the VIC 64S
317name.
318- Was it really sold as VC 64 in Germany, or was it just a nickname used
319at launch to indicate standard C64 units?
320- What's the difference between Educator 64-1 and Educator 64-2? My guess
321is that Edu64-1 was a standard PET64/CBMB4064 with a different name, while
322the Edu64-1 used the full C64 BIOS. Confirmations are needed, anyway.
191323 */
192324
193325#include "driver.h"
r3189r3190
203335#include "includes/c64.h"
204336
205337
338/*************************************
339 *
340 *  Main CPU memory handlers
341 *
342 *************************************/
343
206344static ADDRESS_MAP_START(ultimax_mem , ADDRESS_SPACE_PROGRAM, 8)
207345   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_BASE(&c64_memory)
208346   AM_RANGE(0x8000, 0x9fff) AM_ROM AM_BASE(&c64_roml)
r3189r3190
322460
323461
324462
463/*************************************
464 *
465 *  Graphics definitions
466 *
467 *************************************/
468
469
325470static PALETTE_INIT( pet64 )
326471{
327472   int i;
328   for (i=0; i<16; i++)
329      palette_set_color_rgb(machine, i, 0, vic2_palette[i*3+1], 0);
473   for (i = 0; i < 16; i++)
474      palette_set_color_rgb(machine, i, 0, vic2_palette[i * 3 + 1], 0);
330475}
331476
332ROM_START (ultimax)
333   ROM_REGION (0x10000, "main", ROMREGION_ERASEFF)
334ROM_END
335477
336ROM_START (c64gs)
337   ROM_REGION (0x19400, "main", 0)
338   /* standard basic, modified kernel */
339   ROM_LOAD ("390852.01", 0x10000, 0x4000, CRC(b0a9c2da) SHA1(21940ef5f1bfe67d7537164f7ca130a1095b067a))
340   ROM_LOAD ("901225.01", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa))
341ROM_END
478/*************************************
479 *
480 *  Sound definitions
481 *
482 *************************************/
342483
343ROM_START (c64)
344   ROM_REGION (0x19400, "main", 0)
345   ROM_LOAD ("901226.01", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e))
346   ROM_LOAD ("901227.03", 0x12000, 0x2000, CRC(dbe3e7c7) SHA1(1d503e56df85a62fee696e7618dc5b4e781df1bb))
347   ROM_LOAD ("901225.01", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa))
348ROM_END
349484
350ROM_START (c64pal)
351   ROM_REGION (0x19400, "main", 0)
352   ROM_LOAD ("901226.01", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e))
353   ROM_LOAD ("901227.03", 0x12000, 0x2000, CRC(dbe3e7c7) SHA1(1d503e56df85a62fee696e7618dc5b4e781df1bb))
354   ROM_LOAD ("901225.01", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa))
355ROM_END
356
357ROM_START (vic64s)
358   ROM_REGION (0x19400, "main", 0)
359   ROM_LOAD ("901226.01",   0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e))
360   ROM_LOAD ("kernel.swe",   0x12000, 0x2000, CRC(f10c2c25) SHA1(e4f52d9b36c030eb94524eb49f6f0774c1d02e5e))
361   ROM_LOAD ("charswe.bin",0x14000, 0x1000, CRC(bee9b3fd) SHA1(446ae58f7110d74d434301491209299f66798d8a))
362ROM_END
363
364ROM_START (sx64)
365   ROM_REGION (0x19400, "main", 0)
366   ROM_LOAD ("901226.01", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e))
367   ROM_LOAD( "251104.04", 0x12000, 0x2000, CRC(2c5965d4) SHA1(aa136e91ecf3c5ac64f696b3dbcbfc5ba0871c98))
368   ROM_LOAD ("901225.01", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa))
369   VC1541_ROM ("cpu_vc1540")
370ROM_END
371
372ROM_START (dx64)
373   ROM_REGION (0x19400, "main", 0)
374    ROM_LOAD ("901226.01", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e))
375    ROM_LOAD( "dx64kern.bin",     0x12000, 0x2000, CRC(58065128))
376    // vc1541 roms were not included in submission
377    VC1541_ROM ("cpu_vc1540")
378   //    VC1541_ROM (" ")
379ROM_END
380
381ROM_START (vip64)
382   ROM_REGION (0x19400, "main", 0)
383   ROM_LOAD ("901226.01", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e))
384   ROM_LOAD( "kernelsx.swe",   0x12000, 0x2000, CRC(7858d3d7) SHA1(097cda60469492a8916c2677b7cce4e12a944bc0))
385   ROM_LOAD ("charswe.bin", 0x14000, 0x1000, CRC(bee9b3fd) SHA1(446ae58f7110d74d434301491209299f66798d8a))
386   VC1541_ROM ("cpu_vc1540")
387ROM_END
388
389ROM_START (pet64)
390   ROM_REGION (0x19400, "main", 0)
391   ROM_LOAD ("901226.01", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e))
392   ROM_LOAD( "901246.01", 0x12000, 0x2000, CRC(789c8cc5) SHA1(6c4fa9465f6091b174df27dfe679499df447503c))
393   ROM_LOAD ("901225.01", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa))
394ROM_END
395
396#if 0
397ROM_START (flash8)
398   ROM_REGION (0x1009400, "main", 0)
399#if 1
400    ROM_LOAD ("flash8", 0x010000, 0x002000, CRC(3c4fb703)) // basic
401    ROM_CONTINUE( 0x014000, 0x001000) // empty
402    ROM_CONTINUE( 0x014000, 0x001000) // characterset
403    ROM_CONTINUE( 0x012000, 0x002000) // c64 mode kernel
404    ROM_CONTINUE( 0x015000, 0x002000) // kernel
405#else
406   ROM_LOAD ("flash8", 0x012000-0x6000, 0x008000, CRC(3c4fb703))
407#endif
408ROM_END
409#endif
410
411#if 0
412     /* character rom */
413    ROM_LOAD ("901225.01", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa))
414    ROM_LOAD ("charswe.bin", 0x14000, 0x1000, CRC(bee9b3fd) SHA1(446ae58f7110d74d434301491209299f66798d8a))
415
416   /* basic */
417    ROM_LOAD ("901226.01", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e))
418
419/* in c16 and some other commodore machines:
420   cbm version in kernel at 0xff80 (offset 0x3f80)
421   0x80 means pal version */
422
423    /* scrap */
424     /* modified for alec 64, not booting */
425    ROM_LOAD( "alec64.e0",   0x12000, 0x2000, CRC(2b1b7381 ))
426     /* unique copyright, else speeddos? */
427    ROM_LOAD( "a.e0", 0x12000, 0x2000, CRC(b8f49365 ))
428    /* ? */
429    ROM_LOAD( "kernelx.e0",  0x12000, 0x2000, CRC(beed6d49 ))
430    ROM_LOAD( "kernelx2.e0",  0x12000, 0x2000, CRC(cfb58230 ))
431    /* basic x 2 */
432    ROM_LOAD( "frodo.e0",    0x12000, 0x2000, CRC(6ec94629 ))
433
434     /* commodore versions */
435    /* 901227-01 */
436    ROM_LOAD( "901227.01",  0x12000, 0x2000, CRC(dce782fa ))
437     /* 901227-02 */
438    ROM_LOAD( "901227.02", 0x12000, 0x2000, CRC(a5c687b3 ))
439     /* 901227-03 */
440    ROM_LOAD( "901227.03",   0x12000, 0x2000, CRC(dbe3e7c7) SHA1(1d503e56df85a62fee696e7618dc5b4e781df1bb))
441    /* 901227-03? swedish  */
442    ROM_LOAD( "kernel.swe",   0x12000, 0x2000, CRC(f10c2c25) SHA1(e4f52d9b36c030eb94524eb49f6f0774c1d02e5e))
443    /* c64c 901225-01 + 901227-03 */
444    ROM_LOAD ("251913.01", 0x10000, 0x4000, CRC(0010ec31))
445     /* c64gs 901225-01 with other fillbyte, modified kernel */
446    ROM_LOAD ("390852.01", 0x10000, 0x4000, CRC(b0a9c2da) SHA1(21940ef5f1bfe67d7537164f7ca130a1095b067a))
447    /* sx64 */
448    ROM_LOAD( "251104.04",     0x12000, 0x2000, CRC(2c5965d4 ))
449     /* 251104.04? swedish */
450    ROM_LOAD( "kernel.swe",   0x12000, 0x2000, CRC(7858d3d7 ))
451    /* 4064, Pet64, Educator 64 */
452    ROM_LOAD( "901246.01",     0x12000, 0x2000, CRC(789c8cc5 ))
453
454    /* few differences to above versions */
455    ROM_LOAD( "901227.02b",  0x12000, 0x2000, CRC(f80eb87b ))
456    ROM_LOAD( "901227.03b",  0x12000, 0x2000, CRC(8e5c500d ))
457    ROM_LOAD( "901227.03c",  0x12000, 0x2000, CRC(c13310c2 ))
458
459     /* 64er system v1
460        ieee interface extension for c64 and vc1541!? */
461     ROM_LOAD( "64ersys1.e0", 0x12000, 0x2000, CRC(97d9a4df ))
462    /* 64er system v3 */
463    ROM_LOAD( "64ersys3.e0", 0x12000, 0x2000, CRC(5096b3bd ))
464
465    /* exos v3 */
466    ROM_LOAD( "exosv3.e0",   0x12000, 0x2000, CRC(4e54d020 ))
467     /* 2 bytes different */
468    ROM_LOAD( "exosv3.e0",   0x12000, 0x2000, CRC(26f3339e ))
469
470    /* jiffydos v6.01 by cmd */
471    ROM_LOAD( "jiffy.e0",    0x12000, 0x2000, CRC(2f79984c ))
472
473    /* dolphin with dolphin vc1541 */
474    ROM_LOAD( "mager.e0",    0x12000, 0x2000, CRC(c9bb21bc ))
475    ROM_LOAD( "dos20.e0",    0x12000, 0x2000, CRC(ffaeb9bc ))
476
477    /* speeddos plus
478        parallel interface on userport to modified vc1541 !? */
479    ROM_LOAD( "speeddos.e0", 0x12000, 0x2000, CRC(8438e77b ))
480    /* speeddos plus + */
481    ROM_LOAD( "speeddos.e0", 0x12000, 0x2000, CRC(10aee0ae ))
482    /* speeddos plus and 80 column text */
483    ROM_LOAD( "rom80.e0",    0x12000, 0x2000, CRC(e801dadc ))
484#endif
485
486485static const sid6581_interface c64_sound_interface =
487486{
488487   c64_paddle_read
489488};
490489
490
491/*************************************
492 *
493 *  Machine driver
494 *
495 *************************************/
496
497
491498static MACHINE_DRIVER_START( c64 )
492499   /* basic machine hardware */
493500   MDRV_CPU_ADD("main", M6510, VIC6567_CLOCK)
r3189r3190
578585#endif
579586MACHINE_DRIVER_END
580587
581#define rom_max rom_ultimax
588
589/*************************************
590 *
591 *  ROM definition(s)
592 *
593 *************************************/
594
595
596ROM_START( max )
597   ROM_REGION( 0x10000, "main", ROMREGION_ERASEFF )
598ROM_END
599
600ROM_START( c64 )
601   ROM_REGION( 0x19400, "main", 0 )
602   ROM_LOAD( "901226-01.bin", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) )   // BASIC
603   ROM_SYSTEM_BIOS(0, "default", "Kernal rev. 3" )
604   ROMX_LOAD( "901227-03.bin", 0x12000, 0x2000, CRC(dbe3e7c7) SHA1(1d503e56df85a62fee696e7618dc5b4e781df1bb), ROM_BIOS(1) )   // Kernal
605   ROM_SYSTEM_BIOS(1, "rev1", "Kernal rev. 1" )
606   ROMX_LOAD( "901227-01.bin", 0x12000, 0x2000, CRC(dce782fa) SHA1(87cc04d61fc748b82df09856847bb5c2754a2033), ROM_BIOS(2) )   // Kernal
607   ROM_SYSTEM_BIOS(2, "rev2", "Kernal rev. 2" )
608   ROMX_LOAD( "901227-02.bin", 0x12000, 0x2000, CRC(a5c687b3) SHA1(0e2e4ee3f2d41f00bed72f9ab588b83e306fdb13), ROM_BIOS(3) )   // Kernal
609   ROM_LOAD( "901225-01.bin", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) )   // Character
610ROM_END
611
612#define rom_c64pal   rom_c64
613
614ROM_START( c64jpn )
615   ROM_REGION( 0x19400, "main", 0 )
616   ROM_LOAD( "901226-01.bin", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) )
617   ROM_LOAD( "906145-02.bin", 0x12000, 0x2000, CRC(3a9ef6f1) SHA1(4ff0f11e80f4b57430d8f0c3799ed0f0e0f4565d) )
618   ROM_LOAD( "906143-02.bin", 0x14000, 0x1000, CRC(1604f6c1) SHA1(0fad19dbcdb12461c99657b2979dbb5c2e47b527) )
619ROM_END
620
621
622ROM_START( vic64s )
623   ROM_REGION( 0x19400, "main", 0 )
624   ROM_LOAD( "901226-01.bin",   0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) )
625   ROM_LOAD( "kernel.swe",   0x12000, 0x2000, CRC(f10c2c25) SHA1(e4f52d9b36c030eb94524eb49f6f0774c1d02e5e) )
626   ROM_SYSTEM_BIOS(0, "default", "Swedish Characters" )
627   ROMX_LOAD( "charswe.bin",0x14000, 0x1000, CRC(bee9b3fd) SHA1(446ae58f7110d74d434301491209299f66798d8a), ROM_BIOS(1) )
628   ROM_SYSTEM_BIOS(1, "default", "Swedish Characters (Alt)" )
629   ROMX_LOAD( "charswe2.bin",0x14000, 0x1000, CRC(377a382b) SHA1(20df25e0ba1c88f31689c1521397c96968967fac), ROM_BIOS(2) )
630ROM_END
631
632#define rom_c64swe   rom_vic64s
633
634ROM_START( pet64 )
635   ROM_REGION( 0x19400, "main", 0 )
636   ROM_LOAD( "901226-01.bin", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) )
637   ROM_LOAD( "901246-01.bin", 0x12000, 0x2000, CRC(789c8cc5) SHA1(6c4fa9465f6091b174df27dfe679499df447503c) )
638   ROM_LOAD( "901225-01.bin", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) )
639ROM_END
640
582641#define rom_cbm4064 rom_pet64
642#define rom_edu64   rom_c64
583643
644ROM_START( sx64 )
645   ROM_REGION( 0x19400, "main", 0 )
646   ROM_LOAD( "901226-01.bin", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) )
647   ROM_LOAD( "251104-04.bin", 0x12000, 0x2000, CRC(2c5965d4) SHA1(aa136e91ecf3c5ac64f696b3dbcbfc5ba0871c98) )
648   ROM_LOAD( "901225-01.bin", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) )
584649
650   VC1541_ROM( "cpu_vc1540" )
651ROM_END
652
653ROM_START( dx64 )
654   ROM_REGION( 0x19400, "main", 0 )
655    ROM_LOAD( "901226-01.bin", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) )
656    ROM_LOAD( "dx64kern.bin",     0x12000, 0x2000, CRC(58065128) )
657
658    // vc1541 roms were not included in submission
659    VC1541_ROM ("cpu_vc1540")
660//   VC1541_ROM (" ")
661ROM_END
662
663ROM_START( vip64 )
664   ROM_REGION( 0x19400, "main", 0 )
665   ROM_LOAD( "901226-01.bin", 0x10000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) )
666   ROM_LOAD( "kernelsx.swe",   0x12000, 0x2000, CRC(7858d3d7) SHA1(097cda60469492a8916c2677b7cce4e12a944bc0) )
667   ROM_LOAD( "charswe.bin", 0x14000, 0x1000, CRC(bee9b3fd) SHA1(446ae58f7110d74d434301491209299f66798d8a) )
668
669   VC1541_ROM( "cpu_vc1540" )
670ROM_END
671
672
673ROM_START( c64c )
674   ROM_REGION( 0x19400, "main", 0 )
675   /* standard basic, modified kernel */
676   ROM_LOAD( "251913-01.bin", 0x10000, 0x4000, CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88) )
677   ROM_LOAD( "901225-01.bin", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) )
678ROM_END
679
680#define rom_c64cpal      rom_c64c
681#define rom_c64g      rom_c64c
682
683ROM_START( c64gs )
684   ROM_REGION( 0x19400, "main", 0 )
685   /* standard basic, modified kernel */
686   ROM_LOAD( "390852-01.bin", 0x10000, 0x4000, CRC(b0a9c2da) SHA1(21940ef5f1bfe67d7537164f7ca130a1095b067a) )
687   ROM_LOAD( "901225-01.bin", 0x14000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) )
688ROM_END
689
690
691
692/*************************************
693 *
694 *  System configuration(s)
695 *
696 *************************************/
697
698
585699static SYSTEM_CONFIG_START(c64)
586700   CONFIG_DEVICE(c64_cartslot_getinfo)
587701   CONFIG_DEVICE(cbmfloppy_device_getinfo)
r3189r3190
602716   CONFIG_DEVICE(c64_cartslot_getinfo)
603717SYSTEM_CONFIG_END
604718
719
605720/***************************************************************************
606721
607722  Game driver(s)
608723
609724***************************************************************************/
610725
611/*   YEAR  NAME     PARENT  COMPAT  MACHINE         INPUT   INIT    CONFIG      COMPANY                            FULLNAME */
612COMP(1982, c64,      0,      0,      c64,         c64,   c64,   c64,      "Commodore Business Machines Co.", "Commodore 64 (NTSC)", 0)
613COMP(1982, c64pal,    c64,   0,      c64pal,       c64,   c64pal, c64,      "Commodore Business Machines Co.", "Commodore 64/VC64/VIC64 (PAL)", 0)
614COMP(1982, cbm4064,   c64,   0,      pet64,         c64,   c64,   c64,      "Commodore Business Machines Co.", "CBM4064/PET64/Educator64 (NTSC)", 0)
615COMP(1982, vic64s,    c64,   0,      c64pal,       vic64s,   c64pal, c64,      "Commodore Business Machines Co.", "Commodore 64 Swedish (PAL)", 0)
616COMP(1982, max,      0,      0,      ultimax,      ultimax,ultimax,ultimax,   "Commodore Business Machines Co.", "Commodore Max (Ultimax/VC10)", 0)
617CONS(1987, c64gs,   c64,   0,      c64gs,         c64gs,   c64gs,   c64gs,      "Commodore Business Machines Co.", "C64GS (PAL)", 0)
726/*   YEAR  NAME   PARENT COMPAT MACHINE  INPUT    INIT    CONFIG    COMPANY                            FULLNAME */
618727
619COMP(1983, sx64,   c64,   0,      sx64,         sx64,   sx64,   sx64,      "Commodore Business Machines Co.", "SX64 (PAL)", GAME_NOT_WORKING)
620COMP(1983, vip64,   c64,   0,      sx64,         vip64,   sx64,   sx64,      "Commodore Business Machines Co.", "VIP64 (SX64 PAL), Swedish Expansion Kit", GAME_NOT_WORKING)
621// sx64 with second disk drive
622COMP(198?, dx64,   c64,   0,      sx64,         sx64,   sx64,   sx64,      "Commodore Business Machines Co.", "DX64 (Prototype, PAL)", GAME_NOT_WORKING)
623/*c64 II (cbm named it still c64) */
624/*c64c (bios in 1 chip) */
625/*c64g late 8500/8580 based c64, sold at aldi/germany */
626/*c64cgs late c64, sold in ireland, gs bios?, but with keyboard */
728COMP(1982, max,       0,    0,    ultimax, ultimax, ultimax, ultimax, "Commodore Business Machines Co.", "Commodore Max Machine", 0)
729
730COMP(1982, c64,     0,    0,    c64,     c64,     c64,     c64,     "Commodore Business Machines Co.", "Commodore 64 (NTSC)", 0)
731COMP(1982, c64pal,  c64,  0,    c64pal,  c64,     c64pal,  c64,     "Commodore Business Machines Co.", "Commodore 64 (PAL)", 0)
732COMP(1982, c64jpn,  c64,  0,    c64,     c64,     c64,     c64,     "Commodore Business Machines Co.", "Commodore 64 (Japan)", 0)
733COMP(1982, vic64s,  c64,  0,    c64pal,  vic64s,  c64pal,  c64,     "Commodore Business Machines Co.", "VIC 64S", 0)
734COMP(1982, c64swe,  c64,  0,    c64pal,  vic64s,  c64pal,  c64,     "Commodore Business Machines Co.", "Commodore 64 (Sweden)", 0)
735
736COMP(1983, pet64,   c64,  0,    pet64,   c64,     c64,     c64,     "Commodore Business Machines Co.", "PET 64 (NTSC)", 0)
737COMP(1983, cbm4064, c64,  0,    pet64,   c64,     c64,     c64,     "Commodore Business Machines Co.", "CBM 4064 (NTSC)", 0)
738COMP(1983, edu64,   c64,  0,    pet64,   c64,     c64,     c64,     "Commodore Business Machines Co.", "Educator 64 (NTSC)", 0) // maybe different palette?
739
740// missing floppy emulation, among other things
741COMP(1984, sx64,    c64,  0,    sx64,    sx64,    sx64,    sx64,    "Commodore Business Machines Co.", "SX-64 Executive Computer (PAL)", GAME_NOT_WORKING)
742COMP(1984, vip64,   c64,  0,    sx64,    vip64,   sx64,    sx64,    "Commodore Business Machines Co.", "VIP64 (SX64 PAL), Swedish Expansion Kit", GAME_NOT_WORKING)
743COMP(198?, dx64,    c64,  0,    sx64,    sx64,    sx64,    sx64,    "Commodore Business Machines Co.", "DX-64 (Prototype, PAL)", GAME_NOT_WORKING)
744
745COMP(1986, c64c,    c64,  0,    c64,     c64,     c64,     c64,     "Commodore Business Machines Co.", "Commodore 64C (NTSC)", 0)
746COMP(1986, c64cpal, c64,  0,    c64pal,  c64,     c64pal,  c64,     "Commodore Business Machines Co.", "Commodore 64C (PAL)", 0)
747COMP(1986, c64g,    c64,  0,    c64pal,  c64,     c64pal,  c64,     "Commodore Business Machines Co.", "Commodore 64G (PAL)", 0)
748
749CONS(1990, c64gs,   c64,  0,    c64gs,   c64gs,   c64gs,   c64gs,   "Commodore Business Machines Co.", "Commodore 64 Games System (PAL)", 0)
docs/messnew.txt
r3189r3190
2323  had plugged your joystick in port 2). This helps with games which expect
2424  joystick inputs from port 2 of the C16 [Fabio Priuli]
2525
26- [C128] Added support for tape emulation using MESS core functions (only
27  loading, both .wav and .tap formats) [Fabio Priuli]
26- [C128] Added support for tape emulation using MESS core functions
27  (loading and saving, both .wav and .tap formats) [Fabio Priuli]
2828
2929- [C128] Refactored cartridge code to rely on MESS core functions.
3030  Currently, .crt emulation uses unmodified C64 cart code and therefore
3131  support has not improved (yet) [Fabio Priuli]
3232
33- [C64] Added support for tape emulation using MESS core functions (only
34  loading, both .wav and .tap formats) [Fabio Priuli, Roberto Zandona']
33- [C64] Added support for tape emulation using MESS core functions
34  (loading and saving, both .wav and .tap formats) [Fabio Priuli, Roberto
35  Zandona']
3536
3637- [C64] Fixed border color during tape loading [Roberto Zandona']
3738
r3189r3190
6263  when/if more documents will be available [Fabio Priuli]
6364
6465- [COMMODORE] Temporarily commented out VC1540 / VC1541 floppy support from
65  systems which had been promoted from TESTDRIVER status. This fixed asserts
66  and freezes. [Fabio Priuli]
66  systems which had been promoted from TESTDRIVER status. This fixed
67  asserts and freezes. [Fabio Priuli]
6768
69- [COMMODORE] Cleaned up documentation and comments in c16.c, c64.c, c65.c,
70  c128.c and vc20.c. Added missing BASIC revisions, new sets and new
71  clones. In particular, I've tagged as BAD_DUMPS most of the C128/C128D
72  PAL BIOSes and started to use split kernal & character ROMs to make
73  clear their origin and possible incompleteness. When dumps will be
74  confirmed, we will start to use the correct ones. If you own a C128 PAL,
75  please dump its BIOS to verify the content. [Fabio Priuli]
76
6877- [OSCNANO] Implemented RUN/MONITOR keys properly, changed video to
6978  black and white, and fixed quickloading. System is now fully
7079  working, including the "Säkkijärven polkka" program. [Curt Coder]
r3189r3190
8190
8291- [TMC2000] Fixed quickloading. [Curt Coder]
8392
84- [VIC20] Added support for tape emulation using MESS core functions (only
85  loading, both .wav and .tap formats) [Fabio Priuli]
93- [VIC20] Added support for tape emulation using MESS core functions
94  (loading and saving, both .wav and .tap formats) [Fabio Priuli]
8695
8796- [VIC20] Refactored cartridge code to rely on MESS core functions. As
8897  a result carts are now working (fixed remaining half of bug #1603). Also

Previous 15994 Revisions Next


© 1998-2018 The MESS Team