* DiscImageChef.DiscImages/NDIF.cs:

Correctec chunk sector counting.

	* DiscImageChef.Filesystems/ProDOS.cs:
	  Added debug. Corrected volume size.
This commit is contained in:
2016-09-12 01:13:39 +01:00
parent fe623a5dfb
commit e39b45f918
2 changed files with 9 additions and 3 deletions

View File

@@ -309,8 +309,6 @@ namespace DiscImageChef.DiscImages
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian; BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
ImageInfo.sectors += header.sectors;
for(int i = 0; i < header.chunks; i++) for(int i = 0; i < header.chunks; i++)
{ {
// Obsolete read-only NDIF only prepended the header and then put the image without any kind of block references. // Obsolete read-only NDIF only prepended the header and then put the image without any kind of block references.
@@ -353,6 +351,8 @@ namespace DiscImageChef.DiscImages
chunks.Add(bChnk.sector, bChnk); chunks.Add(bChnk.sector, bChnk);
} }
ImageInfo.sectors += header.sectors;
} }
if(header.segmented > 0) if(header.segmented > 0)

View File

@@ -99,27 +99,33 @@ namespace DiscImageChef.Filesystems
byte[] rootDirectoryKeyBlock = imagePlugin.ReadSector(2 + partitionStart); byte[] rootDirectoryKeyBlock = imagePlugin.ReadSector(2 + partitionStart);
ushort prePointer = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0); ushort prePointer = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0);
DicConsole.DebugWriteLine("ProDOS plugin", "prePointer = {0}", prePointer);
if(prePointer != 0) if(prePointer != 0)
return false; return false;
byte storage_type = (byte)((rootDirectoryKeyBlock[0x04] & ProDOSStorageTypeMask) >> 4); byte storage_type = (byte)((rootDirectoryKeyBlock[0x04] & ProDOSStorageTypeMask) >> 4);
DicConsole.DebugWriteLine("ProDOS plugin", "storage_type = {0}", storage_type);
if(storage_type != RootDirectoryType) if(storage_type != RootDirectoryType)
return false; return false;
byte entry_length = rootDirectoryKeyBlock[0x23]; byte entry_length = rootDirectoryKeyBlock[0x23];
DicConsole.DebugWriteLine("ProDOS plugin", "entry_length = {0}", entry_length);
if(entry_length != ProDOSEntryLength) if(entry_length != ProDOSEntryLength)
return false; return false;
byte entries_per_block = rootDirectoryKeyBlock[0x24]; byte entries_per_block = rootDirectoryKeyBlock[0x24];
DicConsole.DebugWriteLine("ProDOS plugin", "entries_per_block = {0}", entries_per_block);
if(entries_per_block != ProDOSEntriesPerBlock) if(entries_per_block != ProDOSEntriesPerBlock)
return false; return false;
ushort bit_map_pointer = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0x27); ushort bit_map_pointer = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0x27);
DicConsole.DebugWriteLine("ProDOS plugin", "bit_map_pointer = {0}", bit_map_pointer);
if(bit_map_pointer > partitionEnd) if(bit_map_pointer > partitionEnd)
return false; return false;
ushort total_blocks = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0x29); ushort total_blocks = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0x29);
return total_blocks <= (partitionEnd - partitionStart); DicConsole.DebugWriteLine("ProDOS plugin", "{0} <= ({1} - {2} + 1)? {3}", total_blocks, partitionEnd, partitionStart, total_blocks <= (partitionEnd - partitionStart + 1));
return total_blocks <= (partitionEnd - partitionStart + 1);
} }
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information) public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)