mirror of
https://github.com/Michaelangel007/apple2_prodos_utils.git
synced 2026-10-22 00:02:22 +00:00
Add support for .hdv (ProDOS) disk images.
This commit is contained in:
1 parent
3462c233be
commit
989cb029e2
2 files changed
+30
-4
No files matched your search
+29
-4
@@ -113,7 +113,25 @@
|
||||
}
|
||||
|
||||
|
||||
// --- Size ---
|
||||
// --- 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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user