Skip to content

Commit

Permalink
[#72] Dumping (Part 7: Fixed iteration over unknown number of revolut…
Browse files Browse the repository at this point in the history
…ions, e.g. internal FDD)
  • Loading branch information
tomas-nestorovic committed Feb 25, 2022
1 parent 7436663 commit 0ccb68f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Main/src/FDD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; pPlanStep<planEnd; pPlanStep++ ){
TInternalTrack::TSectorInfo *const psi=pPlanStep->psi;
const BYTE index=pPlanStep->indexIntoOutputBuffers;
Expand Down
8 changes: 6 additions & 2 deletions Main/src/Image_Dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())){
Expand Down

0 comments on commit 0ccb68f

Please sign in to comment.