Previous 199869 Revisions Next

r20118 Monday 7th January, 2013 at 18:23:45 UTC by Curt Coder
Added FM encoding support to flopimg and wd17xx_dsk. [Curt Coder]
[src/lib/formats]adam_dsk.c comx35_dsk.c d81_dsk.c flopimg.c flopimg.h smx_dsk.c tiki100_dsk.c tvc_dsk.c wd177x_dsk.c wd177x_dsk.h

trunk/src/lib/formats/wd177x_dsk.c
r20117r20118
106106   }
107107}
108108
109bool wd177x_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
109floppy_image_format_t::desc_e* wd177x_format::get_desc_fm(const format &f, int &current_size)
110110{
111   int type = find_size(io, form_factor);
112   if(type == -1)
113      return false;
111   static floppy_image_format_t::desc_e desc[25] = {
112      /* 00 */ { FM, 0xff, f.gap_1 },
113      /* 01 */ { SECTOR_LOOP_START, 0, f.sector_count-1 },
114      /* 02 */ {   FM, 0x00, 6 },
115      /* 03 */ {   CRC_CCITT_FM_START, 1 },
116      /* 04 */ {     RAW, 0x4489, 0 }, // TODO remove
117      /* 05 */ {     FM, 0xfe, 1 },
118      /* 06 */ {     TRACK_ID_FM },
119      /* 07 */ {     HEAD_ID_FM },
120      /* 08 */ {     SECTOR_ID_FM },
121      /* 09 */ {     SIZE_ID_FM },
122      /* 10 */ {   CRC_END, 1 },
123      /* 11 */ {   CRC, 1 },
124      /* 12 */ {   FM, 0xff, f.gap_2 },
125      /* 13 */ {   FM, 0x00, 6 },
126      /* 14 */ {   CRC_CCITT_FM_START, 2 },
127      /* 15 */ {     RAW, 0x4489, 0 }, // TODO remove
128      /* 16 */ {     FM, 0xfb, 1 },
129      /* 17 */ {     SECTOR_DATA_FM, -1 },
130      /* 18 */ {   CRC_END, 2 },
131      /* 19 */ {   CRC, 2 },
132      /* 20 */ {   FM, 0xff, f.gap_3 },
133      /* 21 */ { SECTOR_LOOP_END },
134      /* 22 */ { FM, 0x00, 0 },
135      /* 23 */ { RAWBITS, 0x9254, 0 },
136      /* 24 */ { END }
137   };
114138
115   const format &f = formats[type];
139   current_size = f.gap_1*16;
140   if(f.sector_base_size)
141      current_size += f.sector_base_size * f.sector_count * 16;
142   else {
143      for(int j=0; j != f.sector_count; j++)
144         current_size += f.per_sector_size[j] * 16;
145   }
146   current_size += (6+1+4+2+f.gap_2+6+1+2+f.gap_3) * f.sector_count * 16;
116147
117   floppy_image_format_t::desc_e desc[] = {
148   return desc;
149}
150
151floppy_image_format_t::desc_e* wd177x_format::get_desc_mfm(const format &f, int &current_size)
152{
153   static floppy_image_format_t::desc_e desc[25] = {
118154      /* 00 */ { MFM, 0x4e, f.gap_1 },
119155      /* 01 */ { SECTOR_LOOP_START, 0, f.sector_count-1 },
120156      /* 02 */ {   MFM, 0x00, 12 },
r20117r20118
142178      /* 24 */ { END }
143179   };
144180
145   int current_size = f.gap_1*16;
181   current_size = f.gap_1*16;
146182   if(f.sector_base_size)
147183      current_size += f.sector_base_size * f.sector_count * 16;
148184   else {
r20117r20118
151187   }
152188   current_size += (12+3+1+4+2+f.gap_2+12+3+1+2+f.gap_3) * f.sector_count * 16;
153189
190   return desc;
191}
192
193bool wd177x_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
194{
195   int type = find_size(io, form_factor);
196   if(type == -1)
197      return false;
198
199   const format &f = formats[type];
200   floppy_image_format_t::desc_e *desc;
201   int current_size;
202
203   switch (f.encoding)
204   {
205   case floppy_image::FM:
206      desc = get_desc_fm(f, current_size);
207      break;
208   case floppy_image::MFM:
209   default:
210      desc = get_desc_mfm(f, current_size);
211      break;
212   }
213
154214   int total_size = 200000000/f.cell_size;
155215   int remaining_size = total_size - current_size;
156216   if(remaining_size < 0)
r20117r20118
308368
309369   // Extract the sectors
310370   generate_bitstream_from_track(0, 0, formats[candidates[0]].cell_size, bitstream, track_size, image);
311   extract_sectors_from_bitstream_mfm_pc(bitstream, track_size, sectors, sectdata, sizeof(sectdata));
312371
372   switch (formats[candidates[0]].encoding)
373   {
374   case floppy_image::FM:
375      extract_sectors_from_bitstream_fm_pc(bitstream, track_size, sectors, sectdata, sizeof(sectdata));
376      break;
377   case floppy_image::MFM:
378      extract_sectors_from_bitstream_mfm_pc(bitstream, track_size, sectors, sectdata, sizeof(sectdata));
379      break;
380   }
381
313382   // Check compatibility with every candidate, copy in-place
314383   int *ok_cands = candidates;
315384   for(int i=0; i != candidates_count; i++) {
r20117r20118
343412   candidates_count = ok_cands - candidates;
344413}
345414
346
347415void wd177x_format::extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head)
348416{
349417   UINT8 bitstream[500000/8];
r20117r20118
353421
354422   // Extract the sectors
355423   generate_bitstream_from_track(track, head, f.cell_size, bitstream, track_size, image);
356   extract_sectors_from_bitstream_mfm_pc(bitstream, track_size, sectors, sectdata, sizeof(sectdata));
357424
425   switch (f.encoding)
426   {
427   case floppy_image::FM:
428      extract_sectors_from_bitstream_fm_pc(bitstream, track_size, sectors, sectdata, sizeof(sectdata));
429      break;
430   case floppy_image::MFM:
431      extract_sectors_from_bitstream_mfm_pc(bitstream, track_size, sectors, sectdata, sizeof(sectdata));
432      break;
433   }
434
358435   for(int i=0; i<f.sector_count; i++) {
359436      desc_s &ds = sdesc[i];
360437      desc_xs &xs = sectors[ds.sector_id];
trunk/src/lib/formats/wd177x_dsk.h
r20117r20118
1717   struct format {
1818      UINT32 form_factor;      // See floppy_image for possible values
1919      UINT32 variant;          // See floppy_image for possible values
20      UINT32 encoding;       // See floppy_image for possible values
2021
2122      int cell_size;           // See floppy_image_format_t for details
2223      int sector_count;
r20117r20118
2829      int per_sector_id[40];   // if sector_base_id is -1.  If both per are used, then sector per_sector_id[i] has size per_sector_size[i]
2930      int gap_1;               // Usually around 80 - number of 4e between index and first IDAM sync
3031      int gap_2;               // 22 for <=1.44Mb, 41 for 2.88Mb - number of 4e between sector header and data sync
31      int gap_3;               // Usually 84 - number of 4e between sector crc and next IDAM
32      int gap_3;               // Usually 24 - number of 4e between sector crc and next IDAM
3233   };
3334
3435   // End the array with {}
r20117r20118
4142
4243protected:
4344   const format *formats;
45   floppy_image_format_t::desc_e* get_desc_fm(const format &f, int &current_size);
46   floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int &current_size);
4447   int find_size(io_generic *io, UINT32 form_factor);
4548   int compute_track_size(const format &f) const;
4649   void build_sector_description(const format &d, UINT8 *sectdata, desc_s *sectors) const;
trunk/src/lib/formats/d81_dsk.c
r20117r20118
129129// Unverified gap sizes
130130const d81_format::format d81_format::formats[] = {
131131   {
132   floppy_image::FF_35, floppy_image::DSDD,
132   floppy_image::FF_35, floppy_image::DSDD, floppy_image::MFM,
133133   2000, 10, 80, 2, 512, {}, 1, {}, 32, 22, 35
134134   },
135135   {}
trunk/src/lib/formats/comx35_dsk.c
r20117r20118
4343
4444    TODO:
4545
46    - implement 70 track image detection
46    - implement 70 track image detection (first byte of file = 0x01 -> single sided)
47   - format double sided, single track density
4748
49      :exp:fd:wd1770: track description
50      40xff 6x00
51      fe 4x00 f7 17x00 fb 128x00 f7 17x00
52      fe 2x00 07 00 f7 17x00 fb 128x00 f7 17x00
53      fe 2x00 0e 00 f7 17x00 fb 128x00 f7 16x00
54      fe 2x00 05 00 f7 17x00 fb 128x00 f7 17x00
55      fe 2x00 0c 00 f7 17x00 fb 128x00 f7 16x00
56      fe 2x00 03 00 f7 17x00 fb 128x00 f7 17x00
57      fe 2x00 0a 00 f7 17x00 fb 128x00 f7 16x00
58      fe 2x00 01 00 f7 17x00 fb 128x00 f7 17x00
59      fe 2x00 08 00 f7 17x00 fb 128x00 f7 17x00
60      fe 2x00 0f 00 f7 17x00 fb 128x00 f7 16x00
61      fe 2x00 06 00 f7 17x00 fb 128x00 f7 17x00
62      fe 2x00 0d 00 f7 17x00 fb 128x00 f7 16x00
63      fe 2x00 04 00 f7 17x00 fb 128x00 f7 17x00
64      fe 2x00 0b 00 f7 17x00 fb 128x00 f7 16x00
65      fe 2x00 02 00 f7 17x00 fb 128x00 f7 17x00
66      fe 2x00 09 00 f7 17x00 fb 128x00 f7 3476x00
67
4868*/
4969
5070#include "emu.h"
r20117r20118
7191
7292// Unverified gap sizes
7393const comx35_format::format comx35_format::formats[] = {
74   {   //  70K 5 1/4 inch single density single sided 35 tracks
75      floppy_image::FF_525, floppy_image::SSSD,
76      2000, 16, 35, 1, 128, {}, 0, {}, 100, 22, 84
94   {   //  70K 5 1/4 inch single density, single sided, 35 tracks
95      floppy_image::FF_525, floppy_image::SSSD, floppy_image::FM,
96      4000, 16, 35, 1, 128, {}, -1, { 0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9 }, 40, 11, 10
7797   },
78   {   //  140K 5 1/4 inch single density double sided 35 tracks
79      floppy_image::FF_525, floppy_image::DSSD,
80      2000, 16, 35, 2, 128, {}, 0, {}, 100, 22, 84
98   {   //  140K 5 1/4 inch single density, double sided, 35 tracks
99      floppy_image::FF_525, floppy_image::DSSD, floppy_image::FM,
100      4000, 16, 35, 2, 128, {}, -1, { 0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9 }, 40, 11, 10
81101   },
82   /*{   //  140K 5 1/4 inch quad density single sided 70 tracks
83        floppy_image::FF_525, floppy_image::SSQD,
84        2000, 16, 70, 1, 128, {}, 0, {}, 100, 22, 84
102   /*{   //  140K 5 1/4 inch single density, double track density, single sided, 70 tracks
103        floppy_image::FF_525, floppy_image::SSQD, floppy_image::FM,
104        4000, 16, 70, 1, 128, {}, -1, { 0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9 }, 40, 11, 10
85105    },*/
86106   {}
87107};
88108
89109const floppy_format_type FLOPPY_COMX35_FORMAT = &floppy_image_format_creator<comx35_format>;
90
91
92#ifdef UNUSED_CODE
93
94/*********************************************************************
95
96    formats/comx35_dsk.c
97
98    COMX35 disk images
99
100*********************************************************************/
101
102#include "formats/comx35_dsk.h"
103#include "formats/basicdsk.h"
104
105/***************************************************************************
106    IMPLEMENTATION
107***************************************************************************/
108
109/*-------------------------------------------------
110    FLOPPY_IDENTIFY( comx35_dsk_identify )
111-------------------------------------------------*/
112
113static FLOPPY_IDENTIFY( comx35_dsk_identify )
114{
115   *vote = ((floppy_image_size(floppy) == (35*1*16*128)) || (floppy_image_size(floppy) == (35*2*16*128))) ? 100 : 0;
116
117   return FLOPPY_ERROR_SUCCESS;
118}
119
120/*-------------------------------------------------
121    FLOPPY_CONSTRUCT( comx35_dsk_construct )
122-------------------------------------------------*/
123
124static FLOPPY_CONSTRUCT( comx35_dsk_construct )
125{
126   UINT8 header[1];
127   int heads = 1;
128   int cylinders = 35;
129
130   switch (floppy_image_size(floppy))
131   {
132   case 35*1*16*128:
133      heads = 1;
134      cylinders = 35;
135      break;
136
137   case 35*2*16*128:
138      floppy_image_read(floppy, header, 0x12, 1);
139
140      if (header[0] == 0x01)
141      {
142         heads = 1;
143         cylinders = 70;
144      }
145      else
146      {
147         heads = 2;
148         cylinders = 35;
149      }
150      break;
151   }
152
153   struct basicdsk_geometry geometry;
154   memset(&geometry, 0, sizeof(geometry));
155
156   geometry.heads = heads;
157   geometry.first_sector_id = 0;
158   geometry.sector_length = 128;
159   geometry.tracks = cylinders;
160   geometry.sectors = 16;
161
162   return basicdsk_construct(floppy, &geometry);
163}
164
165/*-------------------------------------------------
166    FLOPPY_OPTIONS( comx35 )
167-------------------------------------------------*/
168
169LEGACY_FLOPPY_OPTIONS_START( comx35 )
170   LEGACY_FLOPPY_OPTION( comx35, "img", "COMX35 floppy disk image", comx35_dsk_identify, comx35_dsk_construct, NULL, NULL )
171LEGACY_FLOPPY_OPTIONS_END
172
173#endif
trunk/src/lib/formats/smx_dsk.c
r20117r20118
6565const smx_format::format smx_format::formats[] =
6666{
6767   {   //  Specialist MX/Orion/B2M disk image
68      floppy_image::FF_525,  floppy_image::DSQD,
68      floppy_image::FF_525,  floppy_image::DSQD, floppy_image::MFM,
6969      2000, 5, 80, 2, 1024, {}, 1, {}, 100, 22, 20
7070   },
7171   {   //  Lucksian Key Orion disk image
72      floppy_image::FF_525,  floppy_image::DSQD,
72      floppy_image::FF_525,  floppy_image::DSQD, floppy_image::MFM,
7373      2000, 9, 80, 2, 512, {}, 1, {}, 100, 22, 20
7474   },
7575   {}
trunk/src/lib/formats/tvc_dsk.c
r20117r20118
6565const tvc_format::format tvc_format::formats[] =
6666{
6767   {   //  720K 5.25 inch
68      floppy_image::FF_525,  floppy_image::DSQD,
68      floppy_image::FF_525,  floppy_image::DSQD, floppy_image::MFM,
6969      2000, 9, 80, 2, 512, {}, 1, {}, 100, 22, 20
7070   },
7171   {   //  360K 5.25 inch
72      floppy_image::FF_525,  floppy_image::SSQD,
72      floppy_image::FF_525,  floppy_image::SSQD, floppy_image::MFM,
7373      2000, 9, 80, 1, 512, {}, 1, {}, 100, 22, 20
7474   },
7575   {}
trunk/src/lib/formats/flopimg.c
r20117r20118
11021102bool floppy_image_format_t::type_no_data(int type) const
11031103{
11041104   return type == CRC_CCITT_START ||
1105      type == CRC_CCITT_FM_START ||
11051106      type == CRC_AMIGA_START ||
11061107      type == CRC_MACHEAD_START ||
11071108      type == CRC_END ||
r20117r20118
11151116   return !type_no_data(type) &&
11161117      type != RAW &&
11171118      type != RAWBITS &&
1118      (type != CRC || (crcs[p1].type != CRC_CCITT && crcs[p1].type != CRC_AMIGA));
1119      (type != CRC || (crcs[p1].type != CRC_CCITT && crcs[p1].type != CRC_CCITT_FM && crcs[p1].type != CRC_AMIGA));
11191120}
11201121
11211122void floppy_image_format_t::collect_crcs(const desc_e *desc, gen_crc_info *crcs)
r20117r20118
11291130      case CRC_CCITT_START:
11301131         crcs[desc[i].p1].type = CRC_CCITT;
11311132         break;
1133      case CRC_CCITT_FM_START:
1134         crcs[desc[i].p1].type = CRC_CCITT_FM;
1135         break;
11321136      case CRC_AMIGA_START:
11331137         crcs[desc[i].p1].type = CRC_AMIGA;
11341138         break;
r20117r20118
11491153{
11501154   switch(type) {
11511155   case CRC_CCITT: return 32;
1156   case CRC_CCITT_FM: return 32;
11521157   case CRC_AMIGA: return 64;
11531158   case CRC_MACHEAD: return 8;
11541159   default: return 0;
r20117r20118
12421247   mfm_w(buffer, offset, 16, calc_crc_ccitt(buffer, crc->start, crc->end));
12431248}
12441249
1250void floppy_image_format_t::fixup_crc_ccitt_fm(UINT32 *buffer, const gen_crc_info *crc)
1251{
1252   int offset = crc->write;
1253   fm_w(buffer, offset, 16, calc_crc_ccitt(buffer, crc->start, crc->end));
1254}
1255
12451256void floppy_image_format_t::fixup_crc_machead(UINT32 *buffer, const gen_crc_info *crc)
12461257{
12471258   UINT8 v = 0;
r20117r20118
12581269         switch(crcs[i].type) {
12591270         case CRC_AMIGA:   fixup_crc_amiga(buffer, crcs+i); break;
12601271         case CRC_CCITT:   fixup_crc_ccitt(buffer, crcs+i); break;
1272         case CRC_CCITT_FM:   fixup_crc_ccitt_fm(buffer, crcs+i); break;
12611273         case CRC_MACHEAD: fixup_crc_machead(buffer, crcs+i); break;
12621274         }
12631275         if(crcs[i].fixup_mfm_clock) {
r20117r20118
13391351   while(desc[index].type != END) {
13401352      //      printf("%d.%d.%d (%d) - %d %d\n", desc[index].type, desc[index].p1, desc[index].p2, index, offset, offset/8);
13411353      switch(desc[index].type) {
1354      case FM:
1355         for(int i=0; i<desc[index].p2; i++)
1356            fm_w(buffer, offset, 8, desc[index].p1);
1357         break;
1358
13421359      case MFM:
13431360         for(int i=0; i<desc[index].p2; i++)
13441361            mfm_w(buffer, offset, 8, desc[index].p1);
r20117r20118
13611378         mfm_w(buffer, offset, 8, track);
13621379         break;
13631380
1381      case TRACK_ID_FM:
1382         fm_w(buffer, offset, 8, track);
1383         break;
1384
13641385      case TRACK_ID_GCR6:
13651386         raw_w(buffer, offset, 8, gcr6fw_tb[track & 0x3f]);
13661387         break;
r20117r20118
13691390         mfm_w(buffer, offset, 8, head);
13701391         break;
13711392
1393      case HEAD_ID_FM:
1394         fm_w(buffer, offset, 8, head);
1395         break;
1396
13721397      case HEAD_ID_SWAP:
13731398         mfm_w(buffer, offset, 8, !head);
13741399         break;
r20117r20118
13811406         mfm_w(buffer, offset, 8, sect[sector_idx].sector_id);
13821407         break;
13831408
1409      case SECTOR_ID_FM:
1410         fm_w(buffer, offset, 8, sect[sector_idx].sector_id);
1411         break;
1412
13841413      case SECTOR_ID_GCR6:
13851414         raw_w(buffer, offset, 8, gcr6fw_tb[sect[sector_idx].sector_id]);
13861415         break;
r20117r20118
13931422         break;
13941423      }
13951424
1425      case SIZE_ID_FM: {
1426         int size = sect[sector_idx].size;
1427         int id;
1428         for(id = 0; size > 128; size >>=1, id++);
1429         fm_w(buffer, offset, 8, id);
1430         break;
1431      }
1432
13961433      case SECTOR_INFO_GCR6:
13971434         raw_w(buffer, offset, 8, gcr6fw_tb[sect[sector_idx].sector_info]);
13981435         break;
r20117r20118
14461483
14471484      case CRC_AMIGA_START:
14481485      case CRC_CCITT_START:
1486      case CRC_CCITT_FM_START:
14491487      case CRC_MACHEAD_START:
14501488         crcs[desc[index].p1].start = offset;
14511489         break;
r20117r20118
14661504         break;
14671505      }
14681506
1507      case SECTOR_DATA_FM: {
1508         const desc_s *csect = sect + (desc[index].p1 >= 0 ? desc[index].p1 : sector_idx);
1509         for(int i=0; i != csect->size; i++)
1510            fm_w(buffer, offset, 8, csect->data[i]);
1511         break;
1512      }
1513
14691514      case SECTOR_DATA_O: {
14701515         const desc_s *csect = sect + (desc[index].p1 >= 0 ? desc[index].p1 : sector_idx);
14711516         for(int i=0; i != csect->size; i++)
trunk/src/lib/formats/flopimg.h
r20117r20118
301301   //! Opcodes of the format description language used by generate_track()
302302   enum {
303303      END,                    //!< End of description
304      FM,                  //!< One byte in p1 to be fm-encoded, msb first, repeated p2 times
304305      MFM,                    //!< One byte in p1 to be mfm-encoded, msb first, repeated p2 times
305306      MFMBITS,                //!< A value of p2 bits in p1 to be mfm-encoded, msb first
306307      RAW,                    //!< One 16 bits word in p1 to be written raw, msb first, repeated p2 times
307308      RAWBITS,                //!< A value of p2 bits in p1 to be copied as-is, msb first
308309      TRACK_ID,               //!< Track id byte, mfm-encoded
310      TRACK_ID_FM,            //!< Track id byte, fm-encoded
309311      TRACK_ID_GCR6,          //!< Track id low 6 bits, gcr6-encoded
310312      HEAD_ID,                //!< Head id byte, mfm-encoded
313      HEAD_ID_FM,             //!< Head id byte, fm-encoded
311314      HEAD_ID_SWAP,           //!< Head id byte swapped (0->1, 1->0), mfm-encoded
312315      TRACK_HEAD_ID_GCR6,     //!< Track id 7th bit + head, gc6-encoded
313316      SECTOR_ID,              //!< Sector id byte, mfm-encoded
317      SECTOR_ID_FM,           //!< Sector id byte, fm-encoded
314318      SECTOR_ID_GCR6,         //!< Sector id byte, gcr6-encoded
315319      SIZE_ID,                //!< Sector size code on one byte [log2(size/128)], mfm-encoded
320      SIZE_ID_FM,             //!< Sector size code on one byte [log2(size/128)], fm-encoded
316321      SECTOR_INFO_GCR6,       //!< Sector info byte, gcr6-encoded
317322      OFFSET_ID_O,            //!< Offset (track*2+head) byte, odd bits, mfm-encoded
318323      OFFSET_ID_E,            //!< Offset (track*2+head) byte, even bits, mfm-encoded
r20117r20118
322327      REMAIN_E,               //!< Remaining sector count, even bits, mfm-encoded, total sector count in p1
323328
324329      SECTOR_DATA,            //!< Sector data to mfm-encode, which in p1, -1 for the current one per the sector id
330      SECTOR_DATA_FM,         //!< Sector data to fm-encode, which in p1, -1 for the current one per the sector id
325331      SECTOR_DATA_O,          //!< Sector data to mfm-encode, odd bits only, which in p1, -1 for the current one per the sector id
326332      SECTOR_DATA_E,          //!< Sector data to mfm-encode, even bits only, which in p1, -1 for the current one per the sector id
327333      SECTOR_DATA_MAC,        //!< Transformed sector data + checksum, mac style, id in p1, -1 for the current one per the sector id
328334
329335      CRC_CCITT_START,        //!< Start a CCITT CRC calculation, with the usual x^16 + x^12 + x^5 + 1 (11021) polynomial, p1 = crc id
336      CRC_CCITT_FM_START,     //!< Start a CCITT CRC calculation, with the usual x^16 + x^12 + x^5 + 1 (11021) polynomial, p1 = crc id
330337      CRC_AMIGA_START,        //!< Start an amiga checksum calculation, p1 = crc id
331338      CRC_MACHEAD_START,      //!< Start of the mac gcr6 sector header checksum calculation (xor of pre-encode 6-bits values, gcr6-encoded)
332339      CRC_END,                //!< End the checksum, p1 = crc id
r20117r20118
542549   void gcr6_decode(UINT8 e0, UINT8 e1, UINT8 e2, UINT8 e3, UINT8 &va, UINT8 &vb, UINT8 &vc);
543550
544551private:
545   enum { CRC_NONE, CRC_AMIGA, CRC_CCITT, CRC_MACHEAD };
552   enum { CRC_NONE, CRC_AMIGA, CRC_CCITT, CRC_CCITT_FM, CRC_MACHEAD };
546553   enum { MAX_CRC_COUNT = 64 };
547554
548555   //! Holds data used internally for generating CRCs.
r20117r20118
560567   int crc_cells_size(int type) const;
561568   void fixup_crc_amiga(UINT32 *buffer, const gen_crc_info *crc);
562569   void fixup_crc_ccitt(UINT32 *buffer, const gen_crc_info *crc);
570   void fixup_crc_ccitt_fm(UINT32 *buffer, const gen_crc_info *crc);
563571   void fixup_crc_machead(UINT32 *buffer, const gen_crc_info *crc);
564572   void fixup_crcs(UINT32 *buffer, gen_crc_info *crcs);
565573   void collect_crcs(const desc_e *desc, gen_crc_info *crcs);
r20117r20118
651659      DSED  = 0x44455344, //!< "DSED", Double-sided extra-density (2880K)
652660   };
653661
662   //! Encodings
663   enum {
664      FM   = 0x2020464D, //!< "  FM", frequency modulation
665      MFM  = 0x204D464D, //!< " MFM", modified frequency modulation
666      M2FM = 0x4D32464D, //!< "M2FM", modified modified frequency modulation
667   };
668
654669// construction/destruction
655670
656671
trunk/src/lib/formats/tiki100_dsk.c
r20117r20118
6565// double sided disks have t0s0,t0s1,t1s0,t1s1... format
6666const tiki100_format::format tiki100_format::formats[] = {
6767   {   //  90K 5 1/4 inch single density single sided
68      floppy_image::FF_525, floppy_image::SSSD,
69      2000, 18, 40, 1, 128, {}, 1, {}, 80, 22, 20
68      floppy_image::FF_525, floppy_image::SSSD, floppy_image::FM,
69      4000, 18, 40, 1, 128, {}, 1, {}, 80, 22, 20
7070   },
7171   {   //  200K 5 1/4 inch double density single sided
72      floppy_image::FF_525, floppy_image::SSDD,
72      floppy_image::FF_525, floppy_image::SSDD, floppy_image::MFM,
7373        2000, 10, 40, 1, 512, {}, -1, { 1,6,2,7,3,8,4,9,5,10 }, 80, 22, 20
7474   },
7575   {   //  400K 5 1/4 inch double density
76      floppy_image::FF_525, floppy_image::DSDD,
76      floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM,
7777        2000, 10, 40, 2, 512, {}, -1, { 1,6,2,7,3,8,4,9,5,10 }, 80, 22, 20
7878   },
7979   {   //  800K 5 1/4 inch quad density
80      floppy_image::FF_525, floppy_image::DSQD,
80      floppy_image::FF_525, floppy_image::DSQD, floppy_image::MFM,
8181        2000, 10, 80, 2, 512, {}, -1, { 1,6,2,7,3,8,4,9,5,10 }, 80, 22, 20
8282   },
8383   {}
trunk/src/lib/formats/adam_dsk.c
r20117r20118
6464// Unverified gap sizes
6565const adam_format::format adam_format::formats[] = {
6666   {   /*  160K 5 1/4 inch double density single sided */
67      floppy_image::FF_525, floppy_image::SSDD,
67      floppy_image::FF_525, floppy_image::SSDD, floppy_image::MFM,
6868      2000,  8, 40, 1, 512, {}, 1, {}, 100, 22, 84
6969   },
7070   {   /*  320K 5 1/4 inch double density */
71      floppy_image::FF_525, floppy_image::DSDD,
71      floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM,
7272      2000,  8, 40, 2, 512, {}, 1, {}, 100, 22, 84
7373   },
7474   {   /*  640K 5 1/4 inch quad density */
75      floppy_image::FF_525, floppy_image::DSQD,
75      floppy_image::FF_525, floppy_image::DSQD, floppy_image::MFM,
7676      2000,  8, 80, 2, 512, {}, 1, {}, 100, 22, 84
7777   },
7878   {   /*  720K 3 1/2 inch double density */
79      floppy_image::FF_35,  floppy_image::DSDD,
79      floppy_image::FF_35,  floppy_image::DSDD, floppy_image::MFM,
8080      2000,  9, 80, 2, 512, {}, 1, {}, 100, 22, 84
8181   },
8282   {   /* 1440K 3 1/2 inch high density */
83      floppy_image::FF_35,  floppy_image::DSHD,
83      floppy_image::FF_35,  floppy_image::DSHD, floppy_image::MFM,
8484      1000, 18, 80, 2, 512, {}, 1, {}, 100, 22, 84
8585   },
8686   {}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team