Refactor AppleDOS and solves bug preventing VTOC from being retrieved as "$Vtoc".

This commit is contained in:
2017-12-22 07:05:08 +00:00
parent 0ad9da7b3a
commit 56986338be
5 changed files with 50 additions and 61 deletions

View File

@@ -48,8 +48,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
if(partition.Start > 0 || imagePlugin.ImageInfo.SectorSize != 256) return false;
int spt;
if(imagePlugin.ImageInfo.Sectors == 455) spt = 13;
else spt = 16;
spt = imagePlugin.ImageInfo.Sectors == 455 ? 13 : 16;
byte[] vtocB = imagePlugin.ReadSector((ulong)(17 * spt));
vtoc = new Vtoc();
@@ -68,8 +67,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
StringBuilder sb = new StringBuilder();
int spt;
if(imagePlugin.ImageInfo.Sectors == 455) spt = 13;
else spt = 16;
spt = imagePlugin.ImageInfo.Sectors == 455 ? 13 : 16;
byte[] vtocB = imagePlugin.ReadSector((ulong)(17 * spt));
vtoc = new Vtoc();
@@ -93,11 +91,13 @@ namespace DiscImageChef.Filesystems.AppleDOS
information = sb.ToString();
xmlFSType = new FileSystemType();
xmlFSType.Bootable = true;
xmlFSType.Clusters = (long)imagePlugin.ImageInfo.Sectors;
xmlFSType.ClusterSize = (int)imagePlugin.ImageInfo.SectorSize;
xmlFSType.Type = "Apple DOS";
xmlFSType = new FileSystemType
{
Bootable = true,
Clusters = (long)imagePlugin.ImageInfo.Sectors,
ClusterSize = (int)imagePlugin.ImageInfo.SectorSize,
Type = "Apple DOS"
};
}
}
}