diff --git a/Main/src/HFE.cpp b/Main/src/HFE.cpp index 47e5dc13..ebc0de8b 100644 --- a/Main/src/HFE.cpp +++ b/Main/src/HFE.cpp @@ -66,29 +66,30 @@ #define TRACK_BYTES_MAX USHRT_MAX - CHFE::CTrackBytes::CTrackBytes(WORD count) - // ctor - : Utils::CCallocPtr( Utils::RoundUpToMuls(count,sizeof(TTrackData)), 0 ) - , count(count) { - ASSERT( count>0 ); // call Invalidate() to indicate "no Bytes" - } - - CHFE::CTrackBytes::CTrackBytes(CTrackBytes &&r) - // move ctor - : count(r.count) { - reset( r.release() ); - } - - void CHFE::CTrackBytes::Invalidate(){ - // disposes all Bytes, rendering this object unusable - reset(nullptr), count=0; - } - - void CHFE::CTrackBytes::ReverseBitsInEachByte() const{ - // reverses the order of bits in each Byte - for( PBYTE p=*this,pLast=GetEnd(); p( Utils::RoundUpToMuls(count,sizeof(TTrackData)), 0 ) + , count(count) { + ASSERT( count>0 ); // call Invalidate() to indicate "no Bytes" + } + + CHFE::CTrackBytes::CTrackBytes(CTrackBytes &&r) + // move ctor + : count(r.count) { + reset( r.release() ); + } + + void CHFE::CTrackBytes::Invalidate(){ + // disposes all Bytes, rendering this object unusable + reset(nullptr), count=0; + } + + void CHFE::CTrackBytes::ReverseBitsInEachByte() const{ + // reverses the order of bits in each Byte + for( PBYTE p=*this,pLast=GetEnd(); pcapsImageInfo.maxcylinder || head>capsImageInfo.maxhead) return CTrackReaderWriter::Invalid; @@ -194,15 +194,15 @@ formatError: ::SetLastError(ERROR_BAD_FORMAT); return dataBitRate*2; // "*2" = data and clock bits } - inline static TLogTime GetCellTime(int dataBitRate){ - return TIME_SECOND(1)/GetTotalBitRate(dataBitRate); - } + inline static TLogTime GetCellTime(int dataBitRate){ + return TIME_SECOND(1)/GetTotalBitRate(dataBitRate); + } TStdWinError CHFE::SetMediumTypeAndGeometry(PCFormat pFormat,PCSide sideMap,TSector firstSectorNumber){ // sets the given MediumType and its geometry; returns Windows standard i/o error EXCLUSIVELY_LOCK_THIS_IMAGE(); // - must be setting Medium compatible with the FloppyInterface specified in the Header - if (header.floppyInterfacemediumType){ case Medium::FLOPPY_DD:{ static constexpr TFloppyInterface Compatibles[]={ TFloppyInterface::IBM_PC_DD, TFloppyInterface::ATARI_ST_DD, TFloppyInterface::AMIGA_DD, TFloppyInterface::CPC_DD, TFloppyInterface::GENERIC_SHUGART, TFloppyInterface::MSX2_DD, TFloppyInterface::C64_DD, TFloppyInterface::EMU_SHUGART, TFloppyInterface::S950_DD }; @@ -225,7 +225,7 @@ formatError: ::SetLastError(ERROR_BAD_FORMAT); } default: return ERROR_UNRECOGNIZED_MEDIA; - } + }*/ // - must be setting Medium compatible with the nominal # of Cells if (pFormat->mediumType!=Medium::UNKNOWN){ const auto mp=Medium::GetProperties(pFormat->mediumType);