mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-19 23:29:05 +00:00
Switches to more realistic gaps.
This commit is contained in:
parent
dde9b73a22
commit
28f2d331a8
@ -72,19 +72,17 @@ std::shared_ptr<Track> AppleDSK::get_track_at_position(Track::Address address) {
|
|||||||
Storage::Disk::PCMSegment segment;
|
Storage::Disk::PCMSegment segment;
|
||||||
const uint8_t track = static_cast<uint8_t>(address.position.as_int());
|
const uint8_t track = static_cast<uint8_t>(address.position.as_int());
|
||||||
|
|
||||||
|
// Write gap 1.
|
||||||
|
segment += Encodings::AppleGCR::six_and_two_sync(16);
|
||||||
|
|
||||||
// In either case below, the code aims for exactly 50,000 bits per track.
|
// In either case below, the code aims for exactly 50,000 bits per track.
|
||||||
if(sectors_per_track_ == 16) {
|
if(sectors_per_track_ == 16) {
|
||||||
// Write the sectors.
|
// Write the sectors.
|
||||||
for(uint8_t c = 0; c < 16; ++c) {
|
for(uint8_t c = 0; c < 16; ++c) {
|
||||||
segment += Encodings::AppleGCR::six_and_two_sync(10);
|
|
||||||
segment += Encodings::AppleGCR::header(254, track, c);
|
segment += Encodings::AppleGCR::header(254, track, c);
|
||||||
segment += Encodings::AppleGCR::six_and_two_sync(10);
|
segment += Encodings::AppleGCR::six_and_two_sync(7); // Gap 2: 7 sync words.
|
||||||
segment += Encodings::AppleGCR::six_and_two_data(&track_data[logical_sector_for_physical_sector(c) * 256]);
|
segment += Encodings::AppleGCR::six_and_two_data(&track_data[logical_sector_for_physical_sector(c) * 256]);
|
||||||
}
|
segment += Encodings::AppleGCR::six_and_two_sync(16); // Gap 3: 16 sync words.
|
||||||
|
|
||||||
// Pad if necessary.
|
|
||||||
if(segment.number_of_bits < 50000) {
|
|
||||||
segment += Encodings::AppleGCR::six_and_two_sync((50000 - segment.number_of_bits) / 10);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO: 5 and 3, 13-sector format. If DSK actually supports it?
|
// TODO: 5 and 3, 13-sector format. If DSK actually supports it?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user