diff --git a/Storage/Disk/MFMDiskController.cpp b/Storage/Disk/MFMDiskController.cpp index 4b30c8ff6..1ae81df9a 100644 --- a/Storage/Disk/MFMDiskController.cpp +++ b/Storage/Disk/MFMDiskController.cpp @@ -199,15 +199,15 @@ void MFMController::write_id_joiner() { } } -void MFMController::write_id_data_joiner(bool is_deleted) { +void MFMController::write_id_data_joiner(bool is_deleted, bool skip_first_gap) { if(get_is_double_density()) { - write_n_bytes(22, 0x4e); + if(!skip_first_gap) write_n_bytes(22, 0x4e); write_n_bytes(12, 0x00); for(int c = 0; c < 3; c++) write_raw_short(Storage::Encodings::MFM::MFMSync); get_crc_generator().set_value(Storage::Encodings::MFM::MFMPostSyncCRCValue); write_byte(is_deleted ? Storage::Encodings::MFM::DeletedDataAddressByte : Storage::Encodings::MFM::DataAddressByte); } else { - write_n_bytes(11, 0xff); + if(!skip_first_gap) write_n_bytes(11, 0xff); write_n_bytes(6, 0x00); get_crc_generator().reset(); get_crc_generator().add(is_deleted ? Storage::Encodings::MFM::DeletedDataAddressByte : Storage::Encodings::MFM::DataAddressByte); @@ -227,7 +227,7 @@ void MFMController::write_start_of_track() { if(get_is_double_density()) { write_n_bytes(80, 0x4e); write_n_bytes(12, 0x00); - for(int c = 0; c < 3; c++) write_raw_short(Storage::Encodings::MFM::MFMIndexSync); + for(int c = 0; c < 3; c++) write_raw_short(Storage::Encodings::MFM::MFMIndexSync); write_byte(Storage::Encodings::MFM::IndexAddressByte); write_n_bytes(50, 0x4e); } else { diff --git a/Storage/Disk/MFMDiskController.hpp b/Storage/Disk/MFMDiskController.hpp index b5bef5bd2..206246ba2 100644 --- a/Storage/Disk/MFMDiskController.hpp +++ b/Storage/Disk/MFMDiskController.hpp @@ -125,11 +125,12 @@ class MFMController: public Controller { void write_id_joiner(); /*! - Writes everything that should, per the spec, appear after the ID's CRC, up to and + Writes at most what should, per the spec, appear after the ID's CRC, up to and including the mark that indicates the beginning of data, appropriately seeding - the CRC generator. + the CRC generator; if @c skip_first_gap is set then the initial gap after the + CRC isn't written. */ - void write_id_data_joiner(bool is_deleted); + void write_id_data_joiner(bool is_deleted, bool skip_first_gap); /*! Writes the gap expected after a sector's data CRC and before the beginning of the