mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-06-02 20:41:38 +00:00
Tweak Struct Extra
This commit is contained in:
parent
54ebde9fec
commit
47a9b231e9
|
@ -344,6 +344,7 @@ void Disk2InterfaceCard::ReadTrack(const int drive, ULONG uExecutedCycles)
|
||||||
pFloppy->m_trackimage,
|
pFloppy->m_trackimage,
|
||||||
&pFloppy->m_nibbles,
|
&pFloppy->m_nibbles,
|
||||||
&pFloppy->m_bitCount,
|
&pFloppy->m_bitCount,
|
||||||
|
&pFloppy->m_isFluxTrack,
|
||||||
m_enhanceDisk);
|
m_enhanceDisk);
|
||||||
|
|
||||||
if (!ImageIsWOZ(pFloppy->m_imagehandle))
|
if (!ImageIsWOZ(pFloppy->m_imagehandle))
|
||||||
|
|
|
@ -69,6 +69,7 @@ public:
|
||||||
m_trackimage = NULL;
|
m_trackimage = NULL;
|
||||||
m_trackimagedata = false;
|
m_trackimagedata = false;
|
||||||
m_trackimagedirty = false;
|
m_trackimagedirty = false;
|
||||||
|
m_isFluxTrack = false;
|
||||||
m_longestSyncFFRunLength = 0;
|
m_longestSyncFFRunLength = 0;
|
||||||
m_longestSyncFFBitOffsetStart = -1;
|
m_longestSyncFFBitOffsetStart = -1;
|
||||||
m_initialBitOffset = 0;
|
m_initialBitOffset = 0;
|
||||||
|
@ -90,6 +91,7 @@ public:
|
||||||
LPBYTE m_trackimage;
|
LPBYTE m_trackimage;
|
||||||
bool m_trackimagedata;
|
bool m_trackimagedata;
|
||||||
bool m_trackimagedirty;
|
bool m_trackimagedirty;
|
||||||
|
bool m_isFluxTrack;
|
||||||
UINT m_longestSyncFFRunLength;
|
UINT m_longestSyncFFRunLength;
|
||||||
int m_longestSyncFFBitOffsetStart;
|
int m_longestSyncFFBitOffsetStart;
|
||||||
UINT m_initialBitOffset; // debug
|
UINT m_initialBitOffset; // debug
|
||||||
|
|
|
@ -117,6 +117,7 @@ void ImageReadTrack( ImageInfo* const pImageInfo,
|
||||||
LPBYTE pTrackImageBuffer,
|
LPBYTE pTrackImageBuffer,
|
||||||
int* pNibbles,
|
int* pNibbles,
|
||||||
UINT* pBitCount,
|
UINT* pBitCount,
|
||||||
|
bool* pIsFluxTrack,
|
||||||
bool enhanceDisk)
|
bool enhanceDisk)
|
||||||
{
|
{
|
||||||
_ASSERT(phase >= 0);
|
_ASSERT(phase >= 0);
|
||||||
|
@ -127,9 +128,7 @@ void ImageReadTrack( ImageInfo* const pImageInfo,
|
||||||
|
|
||||||
if (pImageInfo->pImageType->AllowRW())
|
if (pImageInfo->pImageType->AllowRW())
|
||||||
{
|
{
|
||||||
Extra extra;
|
Extra extra(pIsFluxTrack, enhanceDisk);
|
||||||
extra.enhanceDisk = enhanceDisk;
|
|
||||||
extra.isFluxTrack = false;
|
|
||||||
pImageInfo->pImageType->Read(pImageInfo, phase, pTrackImageBuffer, pNibbles, pBitCount, extra);
|
pImageInfo->pImageType->Read(pImageInfo, phase, pTrackImageBuffer, pNibbles, pBitCount, extra);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -82,7 +82,7 @@ ImageError_e ImageOpen(const std::string & pszImageFilename, ImageInfo** ppImage
|
||||||
void ImageClose(ImageInfo* const pImageInfo);
|
void ImageClose(ImageInfo* const pImageInfo);
|
||||||
BOOL ImageBoot(ImageInfo* const pImageInfo);
|
BOOL ImageBoot(ImageInfo* const pImageInfo);
|
||||||
|
|
||||||
void ImageReadTrack(ImageInfo* const pImageInfo, float phase, LPBYTE pTrackImageBuffer, int* pNibbles, UINT* pBitCount, bool enhanceDisk);
|
void ImageReadTrack(ImageInfo* const pImageInfo, float phase, LPBYTE pTrackImageBuffer, int* pNibbles, UINT* pBitCount, bool* pIsFluxTrack, bool enhanceDisk);
|
||||||
void ImageWriteTrack(ImageInfo* const pImageInfo, float phase, LPBYTE pTrackImageBuffer, int nNibbles);
|
void ImageWriteTrack(ImageInfo* const pImageInfo, float phase, LPBYTE pTrackImageBuffer, int nNibbles);
|
||||||
bool ImageReadBlock(ImageInfo* const pImageInfo, UINT nBlock, LPBYTE pBlockBuffer);
|
bool ImageReadBlock(ImageInfo* const pImageInfo, UINT nBlock, LPBYTE pBlockBuffer);
|
||||||
bool ImageWriteBlock(ImageInfo* const pImageInfo, UINT nBlock, LPBYTE pBlockBuffer);
|
bool ImageWriteBlock(ImageInfo* const pImageInfo, UINT nBlock, LPBYTE pBlockBuffer);
|
||||||
|
|
|
@ -663,7 +663,7 @@ public:
|
||||||
const UINT track = PhaseToTrack(phase);
|
const UINT track = PhaseToTrack(phase);
|
||||||
ReadTrack(pImageInfo, track, m_pWorkBuffer, TRACK_DENIBBLIZED_SIZE);
|
ReadTrack(pImageInfo, track, m_pWorkBuffer, TRACK_DENIBBLIZED_SIZE);
|
||||||
*pNibbles = NibblizeTrack(pTrackImageBuffer, eDOSOrder, track);
|
*pNibbles = NibblizeTrack(pTrackImageBuffer, eDOSOrder, track);
|
||||||
if (!extra.enhanceDisk)
|
if (!extra.m_enhanceDisk)
|
||||||
SkewTrack(track, *pNibbles, pTrackImageBuffer);
|
SkewTrack(track, *pNibbles, pTrackImageBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -731,7 +731,7 @@ public:
|
||||||
const UINT track = PhaseToTrack(phase);
|
const UINT track = PhaseToTrack(phase);
|
||||||
ReadTrack(pImageInfo, track, m_pWorkBuffer, TRACK_DENIBBLIZED_SIZE);
|
ReadTrack(pImageInfo, track, m_pWorkBuffer, TRACK_DENIBBLIZED_SIZE);
|
||||||
*pNibbles = NibblizeTrack(pTrackImageBuffer, eProDOSOrder, track);
|
*pNibbles = NibblizeTrack(pTrackImageBuffer, eProDOSOrder, track);
|
||||||
if (!extra.enhanceDisk)
|
if (!extra.m_enhanceDisk)
|
||||||
SkewTrack(track, *pNibbles, pTrackImageBuffer);
|
SkewTrack(track, *pNibbles, pTrackImageBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1276,14 +1276,14 @@ public:
|
||||||
{
|
{
|
||||||
BYTE* pTrackMapFlux = ((CWOZHelper::Tmap*)pImageInfo->pWOZTrackMapFlux)->tmap;
|
BYTE* pTrackMapFlux = ((CWOZHelper::Tmap*)pImageInfo->pWOZTrackMapFlux)->tmap;
|
||||||
indexFromTMAP = pTrackMapFlux[(BYTE)(phase * 2)];
|
indexFromTMAP = pTrackMapFlux[(BYTE)(phase * 2)];
|
||||||
extra.isFluxTrack = (indexFromTMAP != CWOZHelper::TMAP_TRACK_EMPTY);
|
*extra.m_pIsFluxTrack = (indexFromTMAP != CWOZHelper::TMAP_TRACK_EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (indexFromTMAP == CWOZHelper::TMAP_TRACK_EMPTY)
|
if (indexFromTMAP == CWOZHelper::TMAP_TRACK_EMPTY)
|
||||||
{
|
{
|
||||||
BYTE* pTrackMap = ((CWOZHelper::Tmap*)pImageInfo->pWOZTrackMap)->tmap;
|
BYTE* pTrackMap = ((CWOZHelper::Tmap*)pImageInfo->pWOZTrackMap)->tmap;
|
||||||
indexFromTMAP = pTrackMap[(BYTE)(phase * 2)];
|
indexFromTMAP = pTrackMap[(BYTE)(phase * 2)];
|
||||||
extra.isFluxTrack = false;
|
*extra.m_pIsFluxTrack = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (indexFromTMAP == CWOZHelper::TMAP_TRACK_EMPTY)
|
if (indexFromTMAP == CWOZHelper::TMAP_TRACK_EMPTY)
|
||||||
|
@ -1292,7 +1292,7 @@ public:
|
||||||
CWOZHelper::TRKv2* pTRKS = (CWOZHelper::TRKv2*) &pImageInfo->pImageBuffer[pImageInfo->uOffset];
|
CWOZHelper::TRKv2* pTRKS = (CWOZHelper::TRKv2*) &pImageInfo->pImageBuffer[pImageInfo->uOffset];
|
||||||
CWOZHelper::TRKv2* pTRK = &pTRKS[indexFromTMAP];
|
CWOZHelper::TRKv2* pTRK = &pTRKS[indexFromTMAP];
|
||||||
|
|
||||||
if (extra.isFluxTrack)
|
if (*extra.m_pIsFluxTrack)
|
||||||
{
|
{
|
||||||
*pBitCount = 0; // NB. use as a "flag" to callee that this is flux data
|
*pBitCount = 0; // NB. use as a "flag" to callee that this is flux data
|
||||||
*pNibbles = pTRK->bitCount; // byte count of flux data
|
*pNibbles = pTRK->bitCount; // byte count of flux data
|
||||||
|
|
|
@ -56,8 +56,10 @@ struct ImageInfo
|
||||||
|
|
||||||
struct Extra
|
struct Extra
|
||||||
{
|
{
|
||||||
bool enhanceDisk;
|
Extra(bool* pIsFluxTrack, bool enhanceDisk) : m_pIsFluxTrack(pIsFluxTrack), m_enhanceDisk(enhanceDisk) { *m_pIsFluxTrack = false; }
|
||||||
bool isFluxTrack;
|
|
||||||
|
const bool m_enhanceDisk; // read-only
|
||||||
|
bool* m_pIsFluxTrack;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CImageBase
|
class CImageBase
|
||||||
|
|
Loading…
Reference in New Issue
Block a user