mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Report better error messages on Brother sector decode.
This commit is contained in:
@@ -9,12 +9,15 @@
|
||||
class Sector
|
||||
{
|
||||
public:
|
||||
enum
|
||||
enum Status
|
||||
{
|
||||
OK,
|
||||
BAD_CHECKSUM
|
||||
BAD_CHECKSUM,
|
||||
MISSING
|
||||
};
|
||||
|
||||
static const std::string statusToString(Status status);
|
||||
|
||||
Sector(int status, int track, int side, int sector, const std::vector<uint8_t>& data):
|
||||
status(status),
|
||||
track(track),
|
||||
|
||||
@@ -73,10 +73,12 @@ int main(int argc, const char* argv[])
|
||||
for (int i=0; i<SECTOR_COUNT; i++)
|
||||
{
|
||||
auto& sector = readSectors[i];
|
||||
if (!sector || (sector->status != Sector::OK))
|
||||
Sector::Status status = sector ? (Sector::Status)sector->status : Sector::MISSING;
|
||||
if (status != Sector::OK)
|
||||
{
|
||||
std::cout << std::endl
|
||||
<< " Failed to read sector " << i << "; ";
|
||||
<< " Failed to read sector " << i
|
||||
<< " (" << Sector::statusToString(status) << "); ";
|
||||
hasBadSectors = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user