From 58a414675a21aedf1c9c29540f384f1a6a421fbc Mon Sep 17 00:00:00 2001 From: 68bit Date: Thu, 2 Jul 2020 23:10:03 +1000 Subject: wd177x dsk: be permissive of some missing sectors in later tracks A single missing sector was causing it to give up on an images, as incompatible. Being a little more permissive here helps working with some old recovered disk images with some lost sectors. --- src/lib/formats/wd177x_dsk.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/formats/wd177x_dsk.cpp b/src/lib/formats/wd177x_dsk.cpp index 75d76d26f38..fae7bd5f8a6 100644 --- a/src/lib/formats/wd177x_dsk.cpp +++ b/src/lib/formats/wd177x_dsk.cpp @@ -460,7 +460,12 @@ void wd177x_format::check_compatibility(floppy_image *image, std::vector &c } ns++; } - if(ns != tf.sector_count) + + if(ns > tf.sector_count) + goto fail; + + // Be permissive of some missing sectors in later tracks + if(ns < tf.sector_count && track < 2) goto fail; } } -- cgit v1.2.3