MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / ImageReadTrack

Function ImageReadTrack

source/DiskImage.cpp:125–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123//===========================================================================
124
125void ImageReadTrack( ImageInfo* const pImageInfo,
126 float phase, // phase [0..79] +/- 0.5
127 LPBYTE pTrackImageBuffer,
128 int* pNibbles,
129 UINT* pBitCount,
130 bool enhanceDisk)
131{
132 _ASSERT(phase >= 0);
133 if (phase < 0)
134 phase = 0;
135
136 const UINT track = pImageInfo->pImageType->PhaseToTrack(phase);
137
138 if (pImageInfo->pImageType->AllowRW())
139 {
140 pImageInfo->pImageType->Read(pImageInfo, phase, pTrackImageBuffer, pNibbles, pBitCount, enhanceDisk);
141 }
142 else
143 {
144 *pNibbles = (int) ImageGetMaxNibblesPerTrack(pImageInfo);
145 for (int i = 0; i < *pNibbles; i++)
146 pTrackImageBuffer[i] = (BYTE)(rand() & 0xFF);
147 }
148}
149
150//===========================================================================
151

Callers 1

ReadTrackMethod · 0.85

Calls 4

PhaseToTrackMethod · 0.80
AllowRWMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected