picosonic / bbc-fdc

Floppy disk interface for Raspberry Pi
MIT License
243 stars 22 forks source link

Sort sectors by their physical position #25

Closed picosonic closed 3 years ago

picosonic commented 3 years ago

When capturing data sectors are added to the disk store in the order which they were found.

Since we are doing 3 passes for each track it can happen that some sectors were missed on the first rotation but read on the second or third. Which results in the sectors being ordered out of sequence.

For raw formats and sector dump images this doesn't matter, but for those formats which store sectors as found regardless of id (like .td0 and .fsd) we need to preserve the physical location order.

picosonic commented 3 years ago

I've now got a default sort mechanism for sorting sectors physically.

The -sort parameter now sorts the sectors by their logical id.