Add support for .hdv (ProDOS) disk images.

This commit is contained in:
michaelangel007 committed 2026-03-09 08:54:39 -07:00
1 parent 3462c233be
commit 989cb029e2
2 files changed
+29 -3

No files matched your search

+28 -3
View File
@@ -113,6 +113,24 @@
}
// --- File Formats ---
struct FileExtensionType_t
{
const char *pExtension;
SectorOrder_e eSectorOrder;
};
const FileExtensionType_t gaFileExtensionsType[] =
{
{ ".dsk", INTERLEAVE_DOS33_ORDER }
, { ".do" , INTERLEAVE_DOS33_ORDER }
, { ".hdv", INTERLEAVE_PRODOS_ORDER }
, { ".po" , INTERLEAVE_PRODOS_ORDER }
};
const size_t gnFileExtensionsType = sizeof(gaFileExtensionsType) / sizeof(gaFileExtensionsType[0]);
// --- Size ---
int File_Size( FILE *pFile )
@@ -152,9 +170,16 @@ bool DskGetInterleave( const char *dsk_filename )
const char *pExt = file_GetExtension( dsk_filename );
if( pExt )
{
if( stricmp( pExt, ".do" ) == 0 ) giInterleaveLastUsed = INTERLEAVE_DOS33_ORDER ;
if( stricmp( pExt, ".po" ) == 0 ) giInterleaveLastUsed = INTERLEAVE_PRODOS_ORDER;
if( stricmp( pExt, ".dsk") == 0 ) giInterleaveLastUsed = INTERLEAVE_DOS33_ORDER ;
const int nExtensions = (int)gnFileExtensionsType;
for (int iExtension = 0; iExtension < nExtensions; iExtension++)
{
const FileExtensionType_t *pExtType = &gaFileExtensionsType[iExtension];
if (stricmp(pExt, pExtType->pExtension) == 0)
{
giInterleaveLastUsed = pExtType->eSectorOrder;
break;
}
}
}
#if DEBUG_DSK_INTERLEAVE
+1
View File
@@ -210,6 +210,7 @@ int usage()
" .dsk (Assumes DOS3.3 sector order)\n"
" .do (DOS3.3 sector order)\n"
" .po (ProDOS sector order)\n"
" .hdv (ProDOS sector order)\n"
"\n"
"NOTE: To skip always having to specify the <.dsk> name set the environment variable:\n"
"\n"