Skip to content

Commit

Permalink
[#14] Floppy drive access speed-up (Part 26: Fixing uninitialized pre…
Browse files Browse the repository at this point in the history
…sumption on healthy track structure)
  • Loading branch information
tomas-nestorovic committed Dec 31, 2018
1 parent e12d452 commit b88de34
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Main/src/FDD.cpp
Expand Up @@ -1830,7 +1830,7 @@ error: return LOG_ERROR(::GetLastError());
}
}
}else
PresumeHealthyTrackStructure(cyl,head,nSectors,bufferId,gap3);
PresumeHealthyTrackStructure(cyl,head,nSectors,bufferId,gap3,fillerByte);
// . Track formatted successfully
break;
}
Expand Down Expand Up @@ -2020,7 +2020,7 @@ Utils::Information(buf);}
return params.verifyFormattedTracks;
}

TStdWinError CFDD::PresumeHealthyTrackStructure(TCylinder cyl,THead head,TSector nSectors,PCSectorId bufferId,BYTE gap3){
TStdWinError CFDD::PresumeHealthyTrackStructure(TCylinder cyl,THead head,TSector nSectors,PCSectorId bufferId,BYTE gap3,BYTE fillerByte){
// without formatting it, presumes that given Track contains specified Sectors that are well readable and writeable; returns Windows standard i/o error
EXCLUSIVELY_LOCK_THIS_IMAGE();
LOG_TRACK_ACTION(cyl,head,_T("TStdWinError CFDD::PresumeHealthyTrackStructure"));
Expand All @@ -2029,7 +2029,7 @@ Utils::Information(buf);}
// - explicitly setting Track structure
TInternalTrack::TSectorInfo *psi=( REFER_TO_TRACK(cyl,head) = new TInternalTrack( this, cyl, head, nSectors, bufferId, (PCINT)gap3 ) )->sectors; // Gap3 = calculate Sector start times from information of this Gap3 and individual Sector lengths
for( TSector n=nSectors; n--; psi++ )
psi->data=ALLOCATE_SECTOR_DATA(psi->length);
psi->data=(PSectorData)::memset( ALLOCATE_SECTOR_DATA(psi->length), fillerByte, psi->length );
// - presumption done
return ERROR_SUCCESS;
}
Expand Down
2 changes: 1 addition & 1 deletion Main/src/FDD.h
Expand Up @@ -137,7 +137,7 @@
TStdWinError SaveTrack(TCylinder cyl,THead head) override;
TStdWinError FormatTrack(TCylinder cyl,THead head,TSector nSectors,PCSectorId bufferId,PCWORD bufferLength,PCFdcStatus bufferFdcStatus,BYTE gap3,BYTE fillerByte);
bool RequiresFormattedTracksVerification() const override;
TStdWinError PresumeHealthyTrackStructure(TCylinder cyl,THead head,TSector nSectors,PCSectorId bufferId,BYTE gap3) override;
TStdWinError PresumeHealthyTrackStructure(TCylinder cyl,THead head,TSector nSectors,PCSectorId bufferId,BYTE gap3,BYTE fillerByte) override;
TStdWinError UnformatTrack(TCylinder cyl,THead head);
void SetTitle(LPCTSTR) override;
void SetPathName(LPCTSTR, BOOL = TRUE) override;
Expand Down
2 changes: 1 addition & 1 deletion Main/src/Image.cpp
Expand Up @@ -579,7 +579,7 @@
return false; // verification NOT required by default (but Images abstracting physical drives can override this setting)
}

TStdWinError CImage::PresumeHealthyTrackStructure(TCylinder cyl,THead head,TSector nSectors,PCSectorId bufferId,BYTE gap3){
TStdWinError CImage::PresumeHealthyTrackStructure(TCylinder cyl,THead head,TSector nSectors,PCSectorId bufferId,BYTE gap3,BYTE fillerByte){
// without formatting it, presumes that given Track contains Sectors with specified parameters; returns Windows standard i/o error
return ERROR_NOT_SUPPORTED; // each Track by default must be explicitly formatted to be sure about its structure (but Images abstracting physical drives can override this setting)
}
Expand Down
2 changes: 1 addition & 1 deletion Main/src/Image.h
Expand Up @@ -239,7 +239,7 @@
virtual TStdWinError SaveTrack(TCylinder cyl,THead head);
virtual TStdWinError FormatTrack(TCylinder cyl,THead head,TSector nSectors,PCSectorId bufferId,PCWORD bufferLength,PCFdcStatus bufferFdcStatus,BYTE gap3,BYTE fillerByte)=0;
virtual bool RequiresFormattedTracksVerification() const;
virtual TStdWinError PresumeHealthyTrackStructure(TCylinder cyl,THead head,TSector nSectors,PCSectorId bufferId,BYTE gap3);
virtual TStdWinError PresumeHealthyTrackStructure(TCylinder cyl,THead head,TSector nSectors,PCSectorId bufferId,BYTE gap3,BYTE fillerByte);
virtual TStdWinError UnformatTrack(TCylinder cyl,THead head)=0;
bool __reportWriteProtection__() const;
void __toggleWriteProtection__();
Expand Down
2 changes: 1 addition & 1 deletion Main/src/Image_Dump.cpp
Expand Up @@ -401,7 +401,7 @@
dp.gap3.valueValid=true; // ... then the Gap3 Value found valid and can be used as a reference value for working with the Target Image
}
}
if (dp.target->PresumeHealthyTrackStructure(p.chs.cylinder,p.chs.head,nSectors,bufferId,dp.gap3.value)!=ERROR_SUCCESS)
if (dp.target->PresumeHealthyTrackStructure(p.chs.cylinder,p.chs.head,nSectors,bufferId,dp.gap3.value,dp.fillerByte)!=ERROR_SUCCESS)
goto reformatTrack;
}else
reformatTrack: if ( err=dp.target->FormatTrack(p.chs.cylinder,p.chs.head,nSectors,bufferId,bufferLength,bufferFdcStatus,dp.gap3.value,dp.fillerByte) )
Expand Down

0 comments on commit b88de34

Please sign in to comment.