Previous 15994 Revisions Next

r15038 Thursday 26th April, 2012 at 04:32:38 UTC by Jonathan Gevaryahu
Fixed a logic bug in the dfi header check which surprisingly
doesn't come up at all on GCC (compiler bug?) but does happen
on clang. Also disabled some accidentally enabled debug code,
and handle the case of no index transitions at all properly. [Lord Nightmare, Balrog]
[src/lib/formats]dfi_dsk.c

src/lib/formats/dfi_dsk.c
r15037r15038
8989{
9090   char sign[4];
9191   io_generic_read(io, sign, 0, 4);
92   if (memcmp(sign, "DFER", 4))
92   if (memcmp(sign, "DFER", 4)==0)
9393      fatalerror("Old type Discferret image detected; the mess Discferret decoder will not handle this properly, bailing out!\n");
9494   return memcmp(sign, "DFE2", 4) ? 0 : 100;
9595}
r15037r15038
145145            index_time = total_time;
146146            //index_polarity ^= 1;
147147            //fprintf(stderr,"index state changed to %d at time=%d\n", index_polarity, total_time);
148            fprintf(stderr,"index rising edge seen at time=%d\n", total_time);
148            //fprintf(stderr,"index rising edge seen at time=%d\n", total_time);
149149            if (onerev_time == 0) onerev_time = total_time;
150150            index_count =+ 1;//index_polarity;
151151         } else // (v & 0x80) == 0
152152            total_time += v & 0x7f;
153153      }
154     
155      // its possible on single read images for there to be no index pulse during the image at all!
156      if (onerev_time == 0) onerev_time = total_time;
154157
155      //if(!track && !head)
158      if(!track && !head)
156159         fprintf(stderr, "%02d:%d tt=%10d it=%10d\n", track, head, total_time, index_time);
157160      if(!track && !head) {
158161         fprintf(stderr, "index_count: %d, onerev_time: %d\n", index_count, onerev_time);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team