From 3633285aaa9848a89fbf4fb8dc208a6aed306815 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 16 Jul 2019 16:36:00 -0400 Subject: [PATCH] Ensures a trailing zero bit isn't dropped. --- Storage/Disk/Track/TrackSerialiser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Storage/Disk/Track/TrackSerialiser.cpp b/Storage/Disk/Track/TrackSerialiser.cpp index 1741419ca..61b6d845c 100644 --- a/Storage/Disk/Track/TrackSerialiser.cpp +++ b/Storage/Disk/Track/TrackSerialiser.cpp @@ -40,12 +40,13 @@ Storage::Disk::PCMSegment Storage::Disk::track_serialisation(const Track &track, Time time_error = Time(0); while(true) { Track::Event next_event = track_copy->get_next_event(); - if(next_event.type == Track::Event::IndexHole) break; Time extended_length = next_event.length * length_multiplier + time_error; time_error.clock_rate = extended_length.clock_rate; time_error.length = extended_length.length % extended_length.clock_rate; pll.run_for(Cycles(static_cast(extended_length.get()))); + + if(next_event.type == Track::Event::IndexHole) break; pll.add_pulse(); // If the PLL is now sufficiently primed, restart, and start recording bits this time.