mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Final cleanup of DiscImageChef.DiscImages.
This commit is contained in:
@@ -44,26 +44,24 @@ namespace DiscImageChef.DiscImages
|
||||
// TODO: Checksum sectors
|
||||
public class AppleNib : ImagePlugin
|
||||
{
|
||||
Dictionary<ulong, byte[]> longSectors;
|
||||
Dictionary<ulong, byte[]> cookedSectors;
|
||||
Dictionary<ulong, byte[]> addressFields;
|
||||
|
||||
readonly ulong[] dosSkewing = {0, 7, 14, 6, 13, 5, 12, 4, 11, 3, 10, 2, 9, 1, 8, 15};
|
||||
readonly ulong[] proDosSkewing = {0, 8, 1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15};
|
||||
|
||||
readonly byte[] pascal_sign = {0x08, 0xA5, 0x0F, 0x29};
|
||||
readonly byte[] pascal2_sign = {0xFF, 0xA2, 0x00, 0x8E};
|
||||
readonly byte[] dos_sign = {0xA2, 0x02, 0x8E, 0x52};
|
||||
readonly byte[] sos_sign = {0xC9, 0x20, 0xF0, 0x3E};
|
||||
readonly byte[] apple3_sign = {0x8D, 0xD0, 0x03, 0x4C, 0xC7, 0xA4};
|
||||
readonly byte[] cpm_sign = {0xA2, 0x55, 0xA9, 0x00, 0x9D, 0x00, 0x0D, 0xCA};
|
||||
readonly byte[] prodos_string = {0x50, 0x52, 0x4F, 0x44, 0x4F, 0x53};
|
||||
readonly byte[] pascal_string = {0x53, 0x59, 0x53, 0x54, 0x45, 0x2E, 0x41, 0x50, 0x50, 0x4C, 0x45};
|
||||
readonly byte[] dos_sign = {0xA2, 0x02, 0x8E, 0x52};
|
||||
readonly ulong[] dosSkewing = {0, 7, 14, 6, 13, 5, 12, 4, 11, 3, 10, 2, 9, 1, 8, 15};
|
||||
readonly byte[] dri_string =
|
||||
{
|
||||
0x43, 0x4F, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x28, 0x43, 0x29, 0x20, 0x31, 0x39, 0x37, 0x39,
|
||||
0x2C, 0x20, 0x44, 0x49, 0x47, 0x49, 0x54, 0x41, 0x4C, 0x20, 0x52, 0x45, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48
|
||||
};
|
||||
readonly byte[] pascal_sign = {0x08, 0xA5, 0x0F, 0x29};
|
||||
readonly byte[] pascal_string = {0x53, 0x59, 0x53, 0x54, 0x45, 0x2E, 0x41, 0x50, 0x50, 0x4C, 0x45};
|
||||
readonly byte[] pascal2_sign = {0xFF, 0xA2, 0x00, 0x8E};
|
||||
readonly byte[] prodos_string = {0x50, 0x52, 0x4F, 0x44, 0x4F, 0x53};
|
||||
readonly ulong[] proDosSkewing = {0, 8, 1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15};
|
||||
readonly byte[] sos_sign = {0xC9, 0x20, 0xF0, 0x3E};
|
||||
Dictionary<ulong, byte[]> addressFields;
|
||||
Dictionary<ulong, byte[]> cookedSectors;
|
||||
Dictionary<ulong, byte[]> longSectors;
|
||||
|
||||
public AppleNib()
|
||||
{
|
||||
@@ -125,7 +123,8 @@ namespace DiscImageChef.DiscImages
|
||||
|
||||
int spt = 0;
|
||||
bool allTracksEqual = true;
|
||||
for(int i = 1; i < tracks.Count; i++) allTracksEqual &= tracks[i - 1].sectors.Length == tracks[i].sectors.Length;
|
||||
for(int i = 1; i < tracks.Count; i++)
|
||||
allTracksEqual &= tracks[i - 1].sectors.Length == tracks[i].sectors.Length;
|
||||
|
||||
if(allTracksEqual) spt = tracks[0].sectors.Length;
|
||||
|
||||
@@ -417,7 +416,6 @@ namespace DiscImageChef.DiscImages
|
||||
return ms.ToArray();
|
||||
}
|
||||
|
||||
#region Unsupported features
|
||||
public override byte[] ReadDiskTag(MediaTagType tag)
|
||||
{
|
||||
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
||||
@@ -558,6 +556,5 @@ namespace DiscImageChef.DiscImages
|
||||
{
|
||||
return null;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user