summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats
diff options
context:
space:
mode:
author Sergey Svishchev <shattered@users.noreply.github.com>2017-02-11 06:42:57 +0300
committer Olivier Galibert <galibert@pobox.com>2017-02-13 19:33:08 +0000
commita783bb3de4f3cb21492f4632ebcbf1dfc9c222ed (patch)
treefc91899a2ff931a2463f07c58b19d02ac6ce10c8 /src/lib/formats
parent63804888caeb2bc166ba6d0947a64990c41a6923 (diff)
dsk_dsk format: propagate CRC error flags
Diffstat (limited to 'src/lib/formats')
-rw-r--r--src/lib/formats/dsk_dsk.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/formats/dsk_dsk.cpp b/src/lib/formats/dsk_dsk.cpp
index 5d72e093d67..08f76c90127 100644
--- a/src/lib/formats/dsk_dsk.cpp
+++ b/src/lib/formats/dsk_dsk.cpp
@@ -192,8 +192,12 @@ static floperr_t dsk_get_indexed_sector_info(floppy_image_legacy *floppy, int he
if (sector_length) {
*sector_length = 1 << (sector_info[pos + 3] + 7);
}
- if (flags)
- *flags = (sector_info[pos + 5] & 0x40) ? ID_FLAG_DELETED_DATA : 0;
+ if (flags) {
+ *flags = 0;
+ if (sector_info[pos + 4] & 0x20) *flags |= ID_FLAG_CRC_ERROR_IN_ID_FIELD;
+ if (sector_info[pos + 5] & 0x20) *flags |= ID_FLAG_CRC_ERROR_IN_DATA_FIELD;
+ if (sector_info[pos + 5] & 0x40) *flags |= ID_FLAG_DELETED_DATA;
+ }
return retVal;
}