WOZ: Support large tracks (fixes #745)

This commit is contained in:
tomcw
2019-12-31 12:07:45 +00:00
parent 183ec2bc8c
commit a28803cbf9
8 changed files with 53 additions and 28 deletions
+8 -2
View File
@@ -168,8 +168,9 @@ void ImageReadTrack( ImageInfo* const pImageInfo,
}
else
{
for (*pNibbles = 0; *pNibbles < NIBBLES_PER_TRACK; (*pNibbles)++)
pTrackImageBuffer[*pNibbles] = (BYTE)(rand() & 0xFF);
*pNibbles = (int) ImageGetMaxNibblesPerTrack(pImageInfo);
for (int i = 0; i < *pNibbles; i++)
pTrackImageBuffer[i] = (BYTE)(rand() & 0xFF);
}
}
@@ -274,6 +275,11 @@ UINT ImagePhaseToTrack(ImageInfo* const pImageInfo, const float phase, const boo
return track;
}
UINT ImageGetMaxNibblesPerTrack(ImageInfo* const pImageInfo)
{
return pImageInfo ? pImageInfo->maxNibblesPerTrack : NIBBLES_PER_TRACK;
}
void GetImageTitle(LPCTSTR pPathname, std::string & pImageName, std::string & pFullName)
{
TCHAR imagetitle[ MAX_DISK_FULL_NAME+1 ];