1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-26 03:29:40 +00:00

Finally unifies disk image file exceptions, and adds a placeholder for Apple DSK.

This commit is contained in:
Thomas Harte
2018-04-27 23:18:45 -04:00
parent 5c74044e62
commit b98d5b790a
29 changed files with 150 additions and 92 deletions
+3 -3
View File
@@ -23,9 +23,9 @@ SSD::SSD(const std::string &file_name) : MFMSectorDump(file_name) {
// very loose validation: the file needs to be a multiple of 256 bytes
// and not ungainly large
if(file_.stats().st_size & 255) throw ErrorNotSSD;
if(file_.stats().st_size < 512) throw ErrorNotSSD;
if(file_.stats().st_size > 800*256) throw ErrorNotSSD;
if(file_.stats().st_size & 255) throw Error::InvalidFormat;
if(file_.stats().st_size < 512) throw Error::InvalidFormat;
if(file_.stats().st_size > 800*256) throw Error::InvalidFormat;
// this has two heads if the suffix is .dsd, one if it's .ssd
head_count_ = (tolower(file_name[file_name.size() - 3]) == 'd') ? 2 : 1;