2006-02-25 20:50:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
2010-01-03 18:43:08 +00:00
|
|
|
#define NIBBLES_PER_TRACK 0x1A00
|
|
|
|
#define TRACK_DENIBBLIZED_SIZE (16 * 256) // #Sectors x Sector-size
|
2006-02-25 20:50:29 +00:00
|
|
|
|
2010-01-03 18:43:08 +00:00
|
|
|
#define TRACKS_STANDARD 35
|
|
|
|
#define TRACKS_EXTRA 5 // Allow up to a 40-track .dsk image (160KB)
|
|
|
|
#define TRACKS_MAX (TRACKS_STANDARD+TRACKS_EXTRA)
|
2006-03-09 21:40:16 +00:00
|
|
|
|
|
|
|
enum ImageError_e
|
|
|
|
{
|
2010-01-03 18:43:08 +00:00
|
|
|
eIMAGE_ERROR_NONE,
|
|
|
|
eIMAGE_ERROR_BAD_POINTER,
|
|
|
|
eIMAGE_ERROR_BAD_SIZE,
|
|
|
|
eIMAGE_ERROR_BAD_FILE,
|
|
|
|
eIMAGE_ERROR_UNSUPPORTED,
|
|
|
|
eIMAGE_ERROR_UNSUPPORTED_HDV,
|
|
|
|
eIMAGE_ERROR_GZ,
|
|
|
|
eIMAGE_ERROR_ZIP,
|
|
|
|
eIMAGE_ERROR_REJECTED_MULTI_ZIP,
|
|
|
|
eIMAGE_ERROR_UNSUPPORTED_MULTI_ZIP,
|
|
|
|
eIMAGE_ERROR_UNABLE_TO_OPEN,
|
|
|
|
eIMAGE_ERROR_UNABLE_TO_OPEN_GZ,
|
|
|
|
eIMAGE_ERROR_UNABLE_TO_OPEN_ZIP,
|
2006-03-09 21:40:16 +00:00
|
|
|
};
|
|
|
|
|
2010-01-03 18:43:08 +00:00
|
|
|
ImageError_e ImageOpen(LPCTSTR pszImageFilename, HIMAGE* hDiskImage_, bool* pWriteProtected_, const bool bCreateIfNecessary, std::string& strFilenameInZip);
|
|
|
|
void ImageClose(const HIMAGE hDiskImage, const bool bOpenError=false);
|
|
|
|
BOOL ImageBoot(const HIMAGE hDiskImage);
|
|
|
|
void ImageDestroy(void);
|
|
|
|
void ImageInitialize(void);
|
2006-03-09 21:40:16 +00:00
|
|
|
|
2010-01-03 18:43:08 +00:00
|
|
|
void ImageReadTrack(const HIMAGE hDiskImage, int nTrack, int nQuarterTrack, LPBYTE pTrackImageBuffer, int* pNibbles);
|
|
|
|
void ImageWriteTrack(const HIMAGE hDiskImage, int nTrack, int nQuarterTrack, LPBYTE pTrackImage, int nNibbles);
|
2009-05-29 21:39:13 +00:00
|
|
|
|
2010-01-03 18:43:08 +00:00
|
|
|
int ImageGetNumTracks(const HIMAGE hDiskImage);
|
|
|
|
bool ImageIsWriteProtected(const HIMAGE hDiskImage);
|
|
|
|
bool ImageIsMultiFileZip(const HIMAGE hDiskImage);
|