diff --git a/Components/8272/i8272.cpp b/Components/8272/i8272.cpp index 38eb0f46e..a98aab74e 100644 --- a/Components/8272/i8272.cpp +++ b/Components/8272/i8272.cpp @@ -131,7 +131,7 @@ void i8272::set_disk(std::shared_ptr disk, int drive) { CONCAT(read_header, __LINE__): WAIT_FOR_EVENT(Event::Token); \ header_[distance_into_section_] = get_latest_token().byte_value; \ distance_into_section_++; \ - if(distance_into_section_ != 7) goto CONCAT(read_header, __LINE__); \ + if(distance_into_section_ < 6) goto CONCAT(read_header, __LINE__); \ set_data_mode(Scanning); #define SET_DRIVE_HEAD_MFM() \ @@ -282,6 +282,10 @@ void i8272::posit_event(int event_type) { main_status_ &= ~StatusRQM; if(distance_into_section_ < (128 << size_)) goto get_byte; + // read CRC, without transferring it + WAIT_FOR_EVENT(Event::Token); + WAIT_FOR_EVENT(Event::Token); + // For a final result phase, post the standard ST0, ST1, ST2, C, H, R, N goto post_st012chrn; diff --git a/Storage/Disk/MFMDiskController.cpp b/Storage/Disk/MFMDiskController.cpp index 13a61263c..d9663f398 100644 --- a/Storage/Disk/MFMDiskController.cpp +++ b/Storage/Disk/MFMDiskController.cpp @@ -49,6 +49,10 @@ MFMController::Token MFMController::get_latest_token() { return latest_token_; } +NumberTheory::CRC16 &MFMController::get_crc_generator() { + return crc_generator_; +} + void MFMController::process_input_bit(int value, unsigned int cycles_since_index_hole) { if(data_mode_ == DataMode::Writing) return; diff --git a/Storage/Disk/MFMDiskController.hpp b/Storage/Disk/MFMDiskController.hpp index a82233bfb..e32e697a2 100644 --- a/Storage/Disk/MFMDiskController.hpp +++ b/Storage/Disk/MFMDiskController.hpp @@ -70,6 +70,9 @@ class MFMController: public Controller { /// @returns The most-recently read token from the surface of the disk. Token get_latest_token(); + /// @returns The controller's CRC generator. This is automatically fed during reading. + NumberTheory::CRC16 &get_crc_generator(); + // Events enum class Event: int { Token = (1 << 0), // Indicates recognition of a new token in the flux stream. Use get_latest_token() for more details.