1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-23 03:32:32 +00:00

Merge branch 'Plus10' into MFMParserDensity

This commit is contained in:
Thomas Harte 2017-08-18 15:48:20 -04:00
commit ef07c33741

View File

@ -175,7 +175,10 @@ template<class T> std::shared_ptr<Storage::Disk::Track>
}
while(segment.data.size() < expected_track_bytes) shifter.add_byte(0x00);
if(segment.data.size() > expected_track_bytes) segment.data.resize(expected_track_bytes);
// Allow the amount of data written to be up to 10% more than the expected size. Which is generous.
size_t max_size = expected_track_bytes + (expected_track_bytes / 10);
if(segment.data.size() > max_size) segment.data.resize(max_size);
segment.number_of_bits = (unsigned int)(segment.data.size() * 8);
return std::shared_ptr<Storage::Disk::Track>(new Storage::Disk::PCMTrack(std::move(segment)));