From 0ccb68fa3fd7b3c4c6a76528f2f79c9a3de0eb82 Mon Sep 17 00:00:00 2001 From: tomascz Date: Fri, 25 Feb 2022 18:22:54 +0100 Subject: [PATCH] [#72] Dumping (Part 7: Fixed iteration over unknown number of revolutions, e.g. internal FDD) --- Main/src/FDD.cpp | 2 +- Main/src/Image_Dump.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Main/src/FDD.cpp b/Main/src/FDD.cpp index 019721c1..88c12696 100644 --- a/Main/src/FDD.cpp +++ b/Main/src/FDD.cpp @@ -879,7 +879,7 @@ error: switch (const TStdWinError err=::GetLastError()){ } } // . executing the above composed Plan - const bool silentlyRecoverFromErrors=rev>=Revolution::ANY_GOOD; + const bool silentlyRecoverFromErrors=rev>=Revolution::NEXT; for( const TPlanStep *pPlanStep=plan; pPlanSteppsi; const BYTE index=pPlanStep->indexIntoOutputBuffers; diff --git a/Main/src/Image_Dump.cpp b/Main/src/Image_Dump.cpp index 87f1d6b6..e1191a73 100644 --- a/Main/src/Image_Dump.cpp +++ b/Main/src/Image_Dump.cpp @@ -529,10 +529,14 @@ LOG_SECTOR_ACTION(&p.chs.sectorId,_T("reading")); if (sPrev!=p.s) // is this the first trial? p.revolution=Revolution::R0; - else if (dp.source->GetAvailableRevolutionCount()<=Revolution::MAX) // is the # of Revolutions limited? + else if (dp.source->GetAvailableRevolutionCount()<=Revolution::MAX){ // is the # of Revolutions limited? if (++p.revolution>=dp.source->GetAvailableRevolutionCount()) p.revolution=Revolution::R0; - bufferSectorData[p.s]=dp.source->GetSectorData( p.chs, p.s, (Revolution::TType)p.revolution, bufferLength+p.s, bufferFdcStatus+p.s ); + bufferSectorData[p.s]=dp.source->GetSectorData( p.chs, p.s, (Revolution::TType)p.revolution, bufferLength+p.s, bufferFdcStatus+p.s ); + }else{ + ++p.revolution; + bufferSectorData[p.s]=dp.source->GetSectorData( p.chs, p.s, Revolution::NEXT, bufferLength+p.s, bufferFdcStatus+p.s ); + } // | showing the Dialog and processing its result LOG_DIALOG_DISPLAY(_T("CErroneousSectorDialog")); switch (LOG_DIALOG_RESULT(d.DoModal())){