1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-09-30 07:55:01 +00:00

Fixed: the final track is inclusive, not exclusive.

This commit is contained in:
Thomas Harte 2019-12-24 23:01:52 -05:00
parent 42dd70dbff
commit 54fe01b532

View File

@ -80,7 +80,7 @@ std::shared_ptr<::Storage::Disk::Track> MSA::get_track_at_position(::Storage::Di
const auto position = address.position.as_int();
if(position < starting_track_) return nullptr;
if(position >= ending_track_) return nullptr;
if(position > ending_track_) return nullptr;
const auto &track = uncompressed_tracks_[size_t(position - starting_track_) * size_t(sides_) + size_t(address.head)];
assert(!track.empty());
@ -88,7 +88,7 @@ std::shared_ptr<::Storage::Disk::Track> MSA::get_track_at_position(::Storage::Di
}
HeadPosition MSA::get_maximum_head_position() {
return HeadPosition(ending_track_);
return HeadPosition(ending_track_ + 1);
}
int MSA::get_head_count() {