mirror of
https://github.com/TomHarte/CLK.git
synced 2025-04-05 04:37:41 +00:00
Merge pull request #212 from TomHarte/MFMParserDensity
Improves the variability of the MFM parser used for static analysis
This commit is contained in:
commit
b24d04fc09
@ -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)));
|
||||
@ -231,7 +234,7 @@ std::unique_ptr<Encoder> Storage::Encodings::MFM::GetFMEncoder(std::vector<uint8
|
||||
#pragma mark - Parser
|
||||
|
||||
Parser::Parser(bool is_mfm) :
|
||||
Storage::Disk::Controller(4000000, 1, 300),
|
||||
Storage::Disk::Controller(4000000, 32, 300),
|
||||
crc_generator_(0x1021, 0xffff),
|
||||
shift_register_(0), is_mfm_(is_mfm),
|
||||
track_(0), head_(0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user