summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author 68bit <info@68bit.org>2020-07-02 23:10:03 +1000
committer 68bit <info@68bit.org>2020-07-03 00:26:32 +1000
commit58a414675a21aedf1c9c29540f384f1a6a421fbc (patch)
treea06e013e93e19c3fc1ad794feb2fecb35cbbde32
parent3a2bf1c61bcef3384e8f2439392f7a698e68fb71 (diff)
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.
-rw-r--r--src/lib/formats/wd177x_dsk.cpp7
1 files changed, 6 insertions, 1 deletions
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<int> &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;
}
}