summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2017-02-18 14:58:00 +0100
committerLars-Dominik Braun <lars@6xq.net>2017-02-18 14:58:00 +0100
commitfee0d870233317f77dca7ddf59e137f8ec38a524 (patch)
treed9c0fca21b147595dafd7f9ac652d8cec60e4349
parent63565100c3ffa1f122b43a98a4e6d3a81989ac99 (diff)
downloadeumel-tools-fee0d870233317f77dca7ddf59e137f8ec38a524.zip
eumel-tools-fee0d870233317f77dca7ddf59e137f8ec38a524.tar.gz
eumel-tools-fee0d870233317f77dca7ddf59e137f8ec38a524.tar.bz2
linearize: Adjust blocksPerChunk based on filesize
It’s just the number of sectors per track for floppies.
-rwxr-xr-xlinearizeDisk.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/linearizeDisk.py b/linearizeDisk.py
index 55f4b06..7fb6495 100755
--- a/linearizeDisk.py
+++ b/linearizeDisk.py
@@ -16,6 +16,14 @@ def linearBlocks (fd):
blockSize = 512
blocksPerChunk = 15
+ if size == 1228800:
+ # 1.2m
+ blocksPerChunk = 15
+ elif size == 368640:
+ # 360k
+ blocksPerChunk = 9
+ else:
+ logging.warning ('Cannot determine blocks per chunk from filesize')
chunkSize = blockSize*blocksPerChunk
chunks = size//chunkSize
skip = 1