Previous 15994 Revisions Next

r15354 Wednesday 30th May, 2012 at 02:25:10 UTC by R. Belmont
flopimg: support MFM formats where the first sector is 0, not 1 (nw)
[src/lib/formats]esq16_dsk.c flopimg.c flopimg.h

src/lib/formats/flopimg.c
r15353r15354
13621362         raw_w(buffer, offset, 8, gcr6fw_tb[(track & 0x40 ? 1 : 0) | (head ? 0x20 : 0)]);
13631363         break;
13641364
1365      case SECTOR_ID:
1365        case SECTOR_ID:
13661366         mfm_w(buffer, offset, 8, sect[sector_idx].sector_id);
13671367         break;
13681368
1369        case SECTOR_ID_ZEROBASED:
1370         mfm_w(buffer, offset, 8, sect[sector_idx].sector_id-1);
1371         break;
1372
13691373      case SECTOR_ID_GCR6:
13701374         raw_w(buffer, offset, 8, gcr6fw_tb[sect[sector_idx].sector_id]);
13711375         break;
src/lib/formats/flopimg.h
r15353r15354
311311      HEAD_ID,                //!< Head id byte, mfm-encoded
312312      TRACK_HEAD_ID_GCR6,     //!< Track id 7th bit + head, gc6-encoded
313313      SECTOR_ID,              //!< Sector id byte, mfm-encoded
314        SECTOR_ID_ZEROBASED,    //!< Sector id byte, mfm-encoded, first sector is 0, not 1
314315      SECTOR_ID_GCR6,         //!< Sector id byte, gcr6-encoded
315316      SIZE_ID,                //!< Sector size code on one byte [log2(size/128)], mfm-encoded
316317      SECTOR_INFO_GCR6,       //!< Sector info byte, gcr6-encoded
src/lib/formats/esq16_dsk.c
r15353r15354
2525   {     MFM, 0xfe, 1 },
2626   {     TRACK_ID },
2727   {     HEAD_ID },
28   {     SECTOR_ID },
28   {     SECTOR_ID_ZEROBASED },
2929   {     SIZE_ID },
3030   {   CRC_END, 1 },
3131   {   CRC, 1 },
r15353r15354
7777
7878    if (size == 512*track_count*head_count*sector_count)
7979    {
80        printf("Identified Ensoniq .img\n");
8180        return;
8281    }
8382
r15353r15354
9998   int track_count, head_count, sector_count;
10099   find_size(io, track_count, head_count, sector_count);
101100
102    printf("esqimg_format::load (trks %d heads %d sectors %d)\n", track_count, head_count, sector_count);
103
104101   UINT8 sectdata[11*512];
105102   desc_s sectors[11];
106103   for(int i=0; i<sector_count; i++) {
r15353r15354
119116
120117   image->set_variant(floppy_image::DSDD);
121118
122    printf("esqimg_format::OK\n");
123
124119   return true;
125120}
126121

Previous 15994 Revisions Next


© 1998-2018 The MESS Team