1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-27 16:31:31 +00:00

Merge pull request #703 from TomHarte/Sup133

Fixed: the final track field in an MSA is inclusive, not exclusive.
This commit is contained in:
Thomas Harte 2019-12-24 23:30:04 -05:00 committed by GitHub
commit daacd6805e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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() {