From 2b0dcf8573796954985a08e4a6fb8f6091c29c3e Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 7 Aug 2017 12:37:45 -0400 Subject: [PATCH] Transcribed the status bits that I think actually need to be obeyed. --- Storage/Disk/Formats/CPCDSK.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Storage/Disk/Formats/CPCDSK.cpp b/Storage/Disk/Formats/CPCDSK.cpp index 668a940fa..99f25132e 100644 --- a/Storage/Disk/Formats/CPCDSK.cpp +++ b/Storage/Disk/Formats/CPCDSK.cpp @@ -124,6 +124,22 @@ std::shared_ptr CPCDSK::get_uncached_track_at_position(unsigned int head, // TODO: obey the status bytes, somehow (?) if(sector_info.status1 || sector_info.status2) { + if(sector_info.status1 & 0x08) { + // The CRC failed in the ID field. + } + + if(sector_info.status2 & 0x20) { + // The CRC failed in the data field. + } + + if(sector_info.status2 & 0x40) { + // This sector is marked as deleted. + } + + if(sector_info.status2 & 0x01) { + // Data field wasn't found. + } + printf("Unhandled: status errors\n"); }