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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user