diff --git a/Main/Main.vcxproj b/Main/Main.vcxproj index 82347e48..d2a14cfa 100644 --- a/Main/Main.vcxproj +++ b/Main/Main.vcxproj @@ -200,6 +200,7 @@ + @@ -242,6 +243,7 @@ + diff --git a/Main/Main.vcxproj.filters b/Main/Main.vcxproj.filters index 7f25f3ad..189c91e9 100644 --- a/Main/Main.vcxproj.filters +++ b/Main/Main.vcxproj.filters @@ -189,6 +189,9 @@ Header Files\Image + + Header Files\Image + @@ -413,6 +416,9 @@ Source Files\Image + + Source Files\Image + diff --git a/Main/src/CtRaw.cpp b/Main/src/CtRaw.cpp new file mode 100644 index 00000000..be3e626e --- /dev/null +++ b/Main/src/CtRaw.cpp @@ -0,0 +1,60 @@ +#include "stdafx.h" +#include "CapsBase.h" +#include "CtRaw.h" + + static LPCTSTR Recognize(PTCHAR){ + static const char SingleDeviceName[]=_T("CT Raw\0"); + return SingleDeviceName; + } + static PImage Instantiate(LPCTSTR){ + return new CCtRaw; + } + const CImage::TProperties CCtRaw::Properties={ + MAKE_IMAGE_ID('C','A','P','S','_','R','A','W'), // a unique identifier + Recognize, // list of recognized device names + Instantiate, // instantiation function + _T("*.raw"), // filter + TMedium::FLOPPY_ANY, // supported Media + 1,2*6144 // Sector supported min and max length + }; + + + + + + + + #define INI_CTRAW _T("CtRaw") + + CCtRaw::CCtRaw() + // ctor + // - base + : CCapsBase(&Properties,true) { + canBeModified=false; // modifications not possible at the moment + } + + + + + + + BOOL CCtRaw::OnSaveDocument(LPCTSTR lpszPathName){ + // True <=> this Image has been successfully saved, otherwise False + ::SetLastError(ERROR_NOT_SUPPORTED); + return FALSE; + } + + TStdWinError CCtRaw::MarkSectorAsDirty(RCPhysicalAddress chs,BYTE nSectorsToSkip,PCFdcStatus pFdcStatus){ + // marks Sector on a given PhysicalAddress as "dirty", plus sets it the given FdcStatus; returns Windows standard i/o error + return ERROR_NOT_SUPPORTED; + } + + TStdWinError CCtRaw::FormatTrack(TCylinder cyl,THead head,TSector nSectors,PCSectorId bufferId,PCWORD bufferLength,PCFdcStatus bufferFdcStatus,BYTE gap3,BYTE fillerByte){ + // formats given Track {Cylinder,Head} to the requested NumberOfSectors, each with corresponding Length and FillerByte as initial content; returns Windows standard i/o error + return ERROR_NOT_SUPPORTED; + } + + TStdWinError CCtRaw::UnformatTrack(TCylinder cyl,THead head){ + // unformats given Track {Cylinder,Head}; returns Windows standard i/o error + return ERROR_NOT_SUPPORTED; + } diff --git a/Main/src/CtRaw.h b/Main/src/CtRaw.h new file mode 100644 index 00000000..4b9d59a9 --- /dev/null +++ b/Main/src/CtRaw.h @@ -0,0 +1,24 @@ +#ifndef CTRAW_H +#define CTRAW_H + + class CCtRaw sealed:public CCapsBase{ + public: + static const TProperties Properties; + + CCtRaw(); + + //BOOL OnOpenDocument(LPCTSTR lpszPathName) override; + BOOL OnSaveDocument(LPCTSTR lpszPathName) override; + //TCylinder GetCylinderCount() const override; + //THead GetNumberOfFormattedSides(TCylinder cyl) const override; + //TSector ScanTrack(TCylinder cyl,THead head,PSectorId bufferId=nullptr,PWORD bufferLength=nullptr,PINT startTimesNanoseconds=nullptr,PBYTE pAvgGap3=nullptr) const override; + //void GetTrackData(TCylinder cyl,THead head,PCSectorId bufferId,PCBYTE bufferNumbersOfSectorsToSkip,TSector nSectors,bool silentlyRecoverFromErrors,PSectorData *outBufferData,PWORD outBufferLengths,TFdcStatus *outFdcStatuses) override; + TStdWinError MarkSectorAsDirty(RCPhysicalAddress chs,BYTE nSectorsToSkip,PCFdcStatus pFdcStatus) override; + //TStdWinError SetMediumTypeAndGeometry(PCFormat pFormat,PCSide sideMap,TSector firstSectorNumber) override; + //void EditSettings() override; + //TStdWinError Reset() override; + TStdWinError FormatTrack(TCylinder cyl,THead head,TSector nSectors,PCSectorId bufferId,PCWORD bufferLength,PCFdcStatus bufferFdcStatus,BYTE gap3,BYTE fillerByte) override; + TStdWinError UnformatTrack(TCylinder cyl,THead head) override; + }; + +#endif // CTRAW_H diff --git a/Main/src/editor.cpp b/Main/src/editor.cpp index 8c0d8531..b78b017f 100644 --- a/Main/src/editor.cpp +++ b/Main/src/editor.cpp @@ -6,6 +6,7 @@ #include "BSDOS.h" #include "CapsBase.h" #include "IPF.h" +#include "CtRaw.h" CRideApp::CRecentFileListEx::CRecentFileListEx(const CRecentFileList &rStdMru) // ctor @@ -174,6 +175,7 @@ cfPerformedDropEffect=::RegisterClipboardFormat(CFSTR_PERFORMEDDROPEFFECT); cfPasteSucceeded=::RegisterClipboardFormat(CFSTR_PASTESUCCEEDED); // - registering recognizable Image types and known DOSes (in alphabetical order) + CImage::known.AddTail( (PVOID)&CCtRaw::Properties ); CImage::known.AddTail( (PVOID)&D80::Properties ); CImage::known.AddTail( (PVOID)&CDsk5::Properties ); CImage::known.AddTail( (PVOID)&CIpf::Properties );