mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-24 12:30:17 +00:00
Improves validation of suspected sync regions.
This commit is contained in:
parent
41075356e2
commit
992a99d792
@ -60,12 +60,17 @@ std::shared_ptr<::Storage::Disk::Track> NIB::get_track_at_position(::Storage::Di
|
||||
for(size_t index = 0; index < track_data.size(); ++index) {
|
||||
if(track_data[index] == 0xd5 && track_data[(index+1)%track_data.size()] == 0xaa) {
|
||||
size_t start = index - 1;
|
||||
while(track_data[start] == 0xff)
|
||||
size_t length = 0;
|
||||
while(track_data[start] == 0xff) {
|
||||
start = (start + track_data.size() - 1) % track_data.size();
|
||||
++length;
|
||||
}
|
||||
|
||||
sync_starts.insert((start + 1) % track_data.size());
|
||||
if(start > index)
|
||||
start_index = start;
|
||||
if(length >= 5) {
|
||||
sync_starts.insert((start + 1) % track_data.size());
|
||||
if(start > index)
|
||||
start_index = start;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user