Previous 15994 Revisions Next

r13755 Tuesday 27th December, 2011 at 18:16:33 UTC by Olivier Galibert
floppy: Add an "unknown" form factor and use it to fix floptool [O. Galibert]
[src/lib/formats]flopimg.h
[src/mess/tools/floptool]main.c

src/lib/formats/flopimg.h
r13754r13755
502502
503503   // Form factors
504504   enum {
505      FF_35   = 0x20203533, // "35  "
506      FF_525  = 0x20353235, // "525 "
505      FF_UNKNOWN  = 0x00000000, // Unknown, useful when converting
506      FF_35       = 0x20203533, // "35  "
507      FF_525      = 0x20353235, // "525 "
507508   };
508509
509510   // Variants
src/mess/tools/floptool/main.c
r13754r13755
7676
7777   for(int i = 0; i != FORMAT_COUNT; i++) {
7878      floppy_image_format_t *fif = formats[i];
79      int score = fif->identify(image);
79      int score = fif->identify(image, floppy_image::FF_UNKNOWN);
8080      if(score > best) {
8181         best = score;
8282         best_fif = fif;
r13754r13755
203203   dest_io.procs = &stdio_ioprocs_noclose;
204204   dest_io.filler = 0xff;
205205
206   floppy_image image(84, 2);
207   if(!source_format->load(&source_io, &image)) {
206   floppy_image image(84, 2, floppy_image::FF_UNKNOWN);
207   if(!source_format->load(&source_io, floppy_image::FF_UNKNOWN, &image)) {
208208      fprintf(stderr, "Error: parsing input file as '%s' failed\n", source_format->name());
209209      return 1;
210210   }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team