mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Added specific console handling for standard, verbose, debug
and error outputs.
This commit is contained in:
@@ -39,6 +39,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
@@ -273,30 +274,26 @@ namespace DiscImageChef.ImagePlugins
|
||||
if (ImageHeader.dataSize == 0x00800C00)
|
||||
{
|
||||
ImageHeader.dataSize = 0x000C8000;
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (2MG plugin): Detected incorrect endian on data size field, correcting.");
|
||||
DicConsole.DebugWriteLine("2MG plugin", "Detected incorrect endian on data size field, correcting.");
|
||||
}
|
||||
|
||||
////if (MainClass.isDebug)
|
||||
//{
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.magic = \"{0}\"", Encoding.ASCII.GetString(magic));
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.creator = \"{0}\"", Encoding.ASCII.GetString(creator));
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.headerSize = {0}", ImageHeader.headerSize);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.version = {0}", ImageHeader.version);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.imageFormat = {0}", ImageHeader.imageFormat);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.flags = 0x{0:X8}", ImageHeader.flags);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.blocks = {0}", ImageHeader.blocks);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.dataOffset = 0x{0:X8}", ImageHeader.dataOffset);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.dataSize = {0}", ImageHeader.dataSize);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.commentOffset = 0x{0:X8}", ImageHeader.commentOffset);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.commentSize = {0}", ImageHeader.commentSize);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.creatorSpecificOffset = 0x{0:X8}", ImageHeader.creatorSpecificOffset);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.creatorSpecificSize = {0}", ImageHeader.creatorSpecificSize);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.reserved1 = 0x{0:X8}", ImageHeader.reserved1);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.reserved2 = 0x{0:X8}", ImageHeader.reserved2);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.reserved3 = 0x{0:X8}", ImageHeader.reserved3);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.reserved4 = 0x{0:X8}", ImageHeader.reserved4);
|
||||
//}
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.magic = \"{0}\"", Encoding.ASCII.GetString(magic));
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.creator = \"{0}\"", Encoding.ASCII.GetString(creator));
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.headerSize = {0}", ImageHeader.headerSize);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.version = {0}", ImageHeader.version);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.imageFormat = {0}", ImageHeader.imageFormat);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.flags = 0x{0:X8}", ImageHeader.flags);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.blocks = {0}", ImageHeader.blocks);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.dataOffset = 0x{0:X8}", ImageHeader.dataOffset);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.dataSize = {0}", ImageHeader.dataSize);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.commentOffset = 0x{0:X8}", ImageHeader.commentOffset);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.commentSize = {0}", ImageHeader.commentSize);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.creatorSpecificOffset = 0x{0:X8}", ImageHeader.creatorSpecificOffset);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.creatorSpecificSize = {0}", ImageHeader.creatorSpecificSize);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.reserved1 = 0x{0:X8}", ImageHeader.reserved1);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.reserved2 = 0x{0:X8}", ImageHeader.reserved2);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.reserved3 = 0x{0:X8}", ImageHeader.reserved3);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.reserved4 = 0x{0:X8}", ImageHeader.reserved4);
|
||||
|
||||
if (ImageHeader.dataSize == 0 && ImageHeader.blocks == 0 && ImageHeader.imageFormat != ProDOSSectorOrder)
|
||||
return false;
|
||||
|
||||
@@ -43,6 +43,7 @@ using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
@@ -350,9 +351,9 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Exception trying to identify image file {0}", this.imagePath);
|
||||
Console.WriteLine("Exception: {0}", ex.Message);
|
||||
Console.WriteLine("Stack trace: {0}", ex.StackTrace);
|
||||
DicConsole.ErrorWriteLine("Exception trying to identify image file {0}", this.imagePath);
|
||||
DicConsole.ErrorWriteLine("Exception: {0}", ex.Message);
|
||||
DicConsole.ErrorWriteLine("Stack trace: {0}", ex.StackTrace);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -479,8 +480,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
if (MatchDiskType.Success && !intrack)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found REM ORIGINAL MEDIA TYPE at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found REM ORIGINAL MEDIA TYPE at line {0}", line);
|
||||
discimage.disktypestr = MatchDiskType.Groups[1].Value;
|
||||
}
|
||||
else if (MatchDiskType.Success && intrack)
|
||||
@@ -489,28 +489,24 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchSession.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found REM SESSION at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found REM SESSION at line {0}", line);
|
||||
currentsession = Byte.Parse(MatchSession.Groups[1].Value);
|
||||
|
||||
// What happens between sessions
|
||||
}
|
||||
else if (MatchLBA.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found REM MSF at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found REM MSF at line {0}", line);
|
||||
// Just ignored
|
||||
}
|
||||
else if (MatchLeadOut.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found REM LEAD-OUT at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found REM LEAD-OUT at line {0}", line);
|
||||
// Just ignored
|
||||
}
|
||||
else if (MatchComment.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found REM at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found REM at line {0}", line);
|
||||
if (discimage.comment == "")
|
||||
discimage.comment = MatchComment.Groups[1].Value; // First comment
|
||||
else
|
||||
@@ -538,8 +534,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
if (MatchArranger.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found ARRANGER at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found ARRANGER at line {0}", line);
|
||||
if (intrack)
|
||||
currenttrack.arranger = MatchArranger.Groups[1].Value;
|
||||
else
|
||||
@@ -547,8 +542,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchBarCode.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found UPC_EAN at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found UPC_EAN at line {0}", line);
|
||||
if (!intrack)
|
||||
discimage.barcode = MatchBarCode.Groups[1].Value;
|
||||
else
|
||||
@@ -556,8 +550,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchCDText.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found CDTEXTFILE at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found CDTEXTFILE at line {0}", line);
|
||||
if (!intrack)
|
||||
discimage.cdtextfile = MatchCDText.Groups[1].Value;
|
||||
else
|
||||
@@ -565,8 +558,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchComposer.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found COMPOSER at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found COMPOSER at line {0}", line);
|
||||
if (intrack)
|
||||
currenttrack.arranger = MatchComposer.Groups[1].Value;
|
||||
else
|
||||
@@ -574,8 +566,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchDiskID.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found DISC_ID at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found DISC_ID at line {0}", line);
|
||||
if (!intrack)
|
||||
discimage.disk_id = MatchDiskID.Groups[1].Value;
|
||||
else
|
||||
@@ -583,8 +574,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchFile.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found FILE at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found FILE at line {0}", line);
|
||||
|
||||
if (currenttrack.sequence != 0)
|
||||
{
|
||||
@@ -664,8 +654,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
|
||||
// File does exist, process it
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): File \"{0}\" found", currentfile.datafile);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "File \"{0}\" found", currentfile.datafile);
|
||||
|
||||
switch (currentfile.filetype)
|
||||
{
|
||||
@@ -686,15 +675,13 @@ namespace DiscImageChef.ImagePlugins
|
||||
else if (MatchFlags.Success)
|
||||
{
|
||||
// TODO: Implement FLAGS support.
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found FLAGS at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found FLAGS at line {0}", line);
|
||||
if (!intrack)
|
||||
throw new FeatureUnsupportedImageException(String.Format("Found FLAGS field in incorrect place at line {0}", line));
|
||||
}
|
||||
else if (MatchGenre.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found GENRE at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found GENRE at line {0}", line);
|
||||
if (intrack)
|
||||
currenttrack.genre = MatchGenre.Groups[1].Value;
|
||||
else
|
||||
@@ -702,8 +689,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchIndex.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found INDEX at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found INDEX at line {0}", line);
|
||||
if (!intrack)
|
||||
throw new FeatureUnsupportedImageException(String.Format("Found INDEX before a track {0}", line));
|
||||
else
|
||||
@@ -720,19 +706,15 @@ namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
cuetracks[currenttrack.sequence - 2].sectors = offset - currentfileoffsetsector;
|
||||
currentfile.offset += cuetracks[currenttrack.sequence - 2].sectors * cuetracks[currenttrack.sequence - 2].bps;
|
||||
////if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Sets currentfile.offset to {0} at line 553", currentfile.offset);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): cuetracks[currenttrack.sequence-2].sectors = {0}", cuetracks[currenttrack.sequence - 2].sectors);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): cuetracks[currenttrack.sequence-2].bps = {0}", cuetracks[currenttrack.sequence - 2].bps);
|
||||
}
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Sets currentfile.offset to {0} at line 553", currentfile.offset);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "cuetracks[currenttrack.sequence-2].sectors = {0}", cuetracks[currenttrack.sequence - 2].sectors);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "cuetracks[currenttrack.sequence-2].bps = {0}", cuetracks[currenttrack.sequence - 2].bps);
|
||||
}
|
||||
}
|
||||
|
||||
if ((index == 0 || (index == 1 && !currenttrack.indexes.ContainsKey(0))) && currenttrack.sequence == 1)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Sets currentfile.offset to {0} at line 559", offset * currenttrack.bps);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Sets currentfile.offset to {0} at line 559", offset * currenttrack.bps);
|
||||
currentfile.offset = offset * currenttrack.bps;
|
||||
}
|
||||
|
||||
@@ -742,16 +724,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchISRC.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found ISRC at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found ISRC at line {0}", line);
|
||||
if (!intrack)
|
||||
throw new FeatureUnsupportedImageException(String.Format("Found ISRC before a track {0}", line));
|
||||
currenttrack.isrc = MatchISRC.Groups[1].Value;
|
||||
}
|
||||
else if (MatchMCN.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found CATALOG at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found CATALOG at line {0}", line);
|
||||
if (!intrack)
|
||||
discimage.mcn = MatchMCN.Groups[1].Value;
|
||||
else
|
||||
@@ -759,8 +739,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchPerformer.Success)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found PERFORMER at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found PERFORMER at line {0}", line);
|
||||
if (intrack)
|
||||
currenttrack.performer = MatchPerformer.Groups[1].Value;
|
||||
else
|
||||
@@ -768,8 +747,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchPostgap.Success)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found POSTGAP at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found POSTGAP at line {0}", line);
|
||||
if (intrack)
|
||||
{
|
||||
currenttrack.postgap = CDRWinMSFToLBA(MatchPostgap.Groups[1].Value);
|
||||
@@ -779,8 +757,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchPregap.Success)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found PREGAP at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found PREGAP at line {0}", line);
|
||||
if (intrack)
|
||||
{
|
||||
currenttrack.pregap = CDRWinMSFToLBA(MatchPregap.Groups[1].Value);
|
||||
@@ -790,8 +767,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchSongWriter.Success)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found SONGWRITER at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found SONGWRITER at line {0}", line);
|
||||
if (intrack)
|
||||
currenttrack.songwriter = MatchSongWriter.Groups[1].Value;
|
||||
else
|
||||
@@ -799,8 +775,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchTitle.Success)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found TITLE at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found TITLE at line {0}", line);
|
||||
if (intrack)
|
||||
currenttrack.title = MatchTitle.Groups[1].Value;
|
||||
else
|
||||
@@ -808,8 +783,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchTrack.Success)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found TRACK at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found TRACK at line {0}", line);
|
||||
if (currentfile.datafile == "")
|
||||
throw new FeatureUnsupportedImageException(String.Format("Found TRACK field before a file is defined at line {0}", line));
|
||||
if (intrack)
|
||||
@@ -825,8 +799,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
currenttrack = new CDRWinTrack();
|
||||
currenttrack.indexes = new Dictionary<int, ulong>();
|
||||
currenttrack.sequence = uint.Parse(MatchTrack.Groups[1].Value);
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Setting currenttrack.sequence to {0}", currenttrack.sequence);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Setting currenttrack.sequence to {0}", currenttrack.sequence);
|
||||
currentfile.sequence = currenttrack.sequence;
|
||||
currenttrack.bps = CDRWinTrackTypeToBytesPerSector(MatchTrack.Groups[2].Value);
|
||||
currenttrack.tracktype = MatchTrack.Groups[2].Value;
|
||||
@@ -946,132 +919,128 @@ namespace DiscImageChef.ImagePlugins
|
||||
discimage.disktype = DiskType.CD;
|
||||
}
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
// DEBUG information
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Disc image parsing results");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Disc CD-TEXT:");
|
||||
if (discimage.arranger == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tArranger is not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tArranger: {0}", discimage.arranger);
|
||||
if (discimage.composer == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tComposer is not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tComposer: {0}", discimage.composer);
|
||||
if (discimage.genre == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tGenre is not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tGenre: {0}", discimage.genre);
|
||||
if (discimage.performer == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPerformer is not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPerformer: {0}", discimage.performer);
|
||||
if (discimage.songwriter == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tSongwriter is not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tSongwriter: {0}", discimage.songwriter);
|
||||
if (discimage.title == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tTitle is not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tTitle: {0}", discimage.title);
|
||||
if (discimage.cdtextfile == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tCD-TEXT binary file not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tCD-TEXT binary file: {0}", discimage.cdtextfile);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Disc information:");
|
||||
if (discimage.disktypestr == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tISOBuster disc type not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tISOBuster disc type: {0}", discimage.disktypestr);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tGuessed disk type: {0}", discimage.disktype);
|
||||
if (discimage.barcode == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tBarcode not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tBarcode: {0}", discimage.barcode);
|
||||
if (discimage.disk_id == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tDisc ID not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tDisc ID: {0}", discimage.disk_id);
|
||||
if (discimage.mcn == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tMCN not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tMCN: {0}", discimage.mcn);
|
||||
if (discimage.comment == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tComment not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tComment: \"{0}\"", discimage.comment);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Session information:");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tDisc contains {0} sessions", discimage.sessions.Count);
|
||||
for (int i = 0; i < discimage.sessions.Count; i++)
|
||||
{
|
||||
// DEBUG information
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Disc image parsing results");
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Disc CD-TEXT:");
|
||||
if (discimage.arranger == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tArranger is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tArranger: {0}", discimage.arranger);
|
||||
if (discimage.composer == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tComposer is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tComposer: {0}", discimage.composer);
|
||||
if (discimage.genre == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tGenre is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tGenre: {0}", discimage.genre);
|
||||
if (discimage.performer == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPerformer is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPerformer: {0}", discimage.performer);
|
||||
if (discimage.songwriter == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tSongwriter is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tSongwriter: {0}", discimage.songwriter);
|
||||
if (discimage.title == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tTitle is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tTitle: {0}", discimage.title);
|
||||
if (discimage.cdtextfile == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tCD-TEXT binary file not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tCD-TEXT binary file: {0}", discimage.cdtextfile);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Disc information:");
|
||||
if (discimage.disktypestr == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tISOBuster disc type not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tISOBuster disc type: {0}", discimage.disktypestr);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tGuessed disk type: {0}", discimage.disktype);
|
||||
if (discimage.barcode == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tBarcode not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tBarcode: {0}", discimage.barcode);
|
||||
if (discimage.disk_id == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tDisc ID not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tDisc ID: {0}", discimage.disk_id);
|
||||
if (discimage.mcn == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tMCN not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tMCN: {0}", discimage.mcn);
|
||||
if (discimage.comment == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tComment not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tComment: \"{0}\"", discimage.comment);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Session information:");
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tDisc contains {0} sessions", discimage.sessions.Count);
|
||||
for (int i = 0; i < discimage.sessions.Count; i++)
|
||||
{
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tSession {0} information:", i + 1);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tStarting track: {0}", discimage.sessions[i].StartTrack);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tStarting sector: {0}", discimage.sessions[i].StartSector);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tEnding track: {0}", discimage.sessions[i].EndTrack);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tEnding sector: {0}", discimage.sessions[i].EndSector);
|
||||
}
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Track information:");
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tDisc contains {0} tracks", discimage.tracks.Count);
|
||||
for (int i = 0; i < discimage.tracks.Count; i++)
|
||||
{
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tTrack {0} information:", discimage.tracks[i].sequence);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tSession {0} information:", i + 1);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tStarting track: {0}", discimage.sessions[i].StartTrack);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tStarting sector: {0}", discimage.sessions[i].StartSector);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tEnding track: {0}", discimage.sessions[i].EndTrack);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tEnding sector: {0}", discimage.sessions[i].EndSector);
|
||||
}
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Track information:");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tDisc contains {0} tracks", discimage.tracks.Count);
|
||||
for (int i = 0; i < discimage.tracks.Count; i++)
|
||||
{
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tTrack {0} information:", discimage.tracks[i].sequence);
|
||||
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\t{0} bytes per sector", discimage.tracks[i].bps);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tPregap: {0} sectors", discimage.tracks[i].pregap);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tData: {0} sectors", discimage.tracks[i].sectors);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tPostgap: {0} sectors", discimage.tracks[i].postgap);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\t{0} bytes per sector", discimage.tracks[i].bps);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tPregap: {0} sectors", discimage.tracks[i].pregap);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tData: {0} sectors", discimage.tracks[i].sectors);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tPostgap: {0} sectors", discimage.tracks[i].postgap);
|
||||
|
||||
if (discimage.tracks[i].flag_4ch)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tTrack is flagged as quadraphonic");
|
||||
if (discimage.tracks[i].flag_dcp)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tTrack allows digital copy");
|
||||
if (discimage.tracks[i].flag_pre)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tTrack has pre-emphasis applied");
|
||||
if (discimage.tracks[i].flag_scms)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tTrack has SCMS");
|
||||
if (discimage.tracks[i].flag_4ch)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tTrack is flagged as quadraphonic");
|
||||
if (discimage.tracks[i].flag_dcp)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tTrack allows digital copy");
|
||||
if (discimage.tracks[i].flag_pre)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tTrack has pre-emphasis applied");
|
||||
if (discimage.tracks[i].flag_scms)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tTrack has SCMS");
|
||||
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tTrack resides in file {0}, type defined as {1}, starting at byte {2}",
|
||||
discimage.tracks[i].trackfile.datafile, discimage.tracks[i].trackfile.filetype, discimage.tracks[i].trackfile.offset);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tTrack resides in file {0}, type defined as {1}, starting at byte {2}",
|
||||
discimage.tracks[i].trackfile.datafile, discimage.tracks[i].trackfile.filetype, discimage.tracks[i].trackfile.offset);
|
||||
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tIndexes:");
|
||||
foreach (KeyValuePair<int, ulong> kvp in discimage.tracks[i].indexes)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\t\tIndex {0} starts at sector {1}", kvp.Key, kvp.Value);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tIndexes:");
|
||||
foreach (KeyValuePair<int, ulong> kvp in discimage.tracks[i].indexes)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\t\tIndex {0} starts at sector {1}", kvp.Key, kvp.Value);
|
||||
|
||||
if (discimage.tracks[i].isrc == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tISRC is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tISRC: {0}", discimage.tracks[i].isrc);
|
||||
if (discimage.tracks[i].isrc == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tISRC is not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tISRC: {0}", discimage.tracks[i].isrc);
|
||||
|
||||
if (discimage.tracks[i].arranger == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tArranger is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tArranger: {0}", discimage.tracks[i].arranger);
|
||||
if (discimage.tracks[i].composer == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tComposer is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tComposer: {0}", discimage.tracks[i].composer);
|
||||
if (discimage.tracks[i].genre == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tGenre is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tGenre: {0}", discimage.tracks[i].genre);
|
||||
if (discimage.tracks[i].performer == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tPerformer is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tPerformer: {0}", discimage.tracks[i].performer);
|
||||
if (discimage.tracks[i].songwriter == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tSongwriter is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tSongwriter: {0}", discimage.tracks[i].songwriter);
|
||||
if (discimage.tracks[i].title == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tTitle is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tTitle: {0}", discimage.tracks[i].title);
|
||||
}
|
||||
if (discimage.tracks[i].arranger == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tArranger is not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tArranger: {0}", discimage.tracks[i].arranger);
|
||||
if (discimage.tracks[i].composer == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tComposer is not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tComposer: {0}", discimage.tracks[i].composer);
|
||||
if (discimage.tracks[i].genre == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tGenre is not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tGenre: {0}", discimage.tracks[i].genre);
|
||||
if (discimage.tracks[i].performer == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tPerformer is not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tPerformer: {0}", discimage.tracks[i].performer);
|
||||
if (discimage.tracks[i].songwriter == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tSongwriter is not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tSongwriter: {0}", discimage.tracks[i].songwriter);
|
||||
if (discimage.tracks[i].title == null)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tTitle is not set.");
|
||||
else
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tTitle: {0}", discimage.tracks[i].title);
|
||||
}
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Building offset map");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Building offset map");
|
||||
|
||||
partitions = new List<CommonTypes.Partition>();
|
||||
|
||||
@@ -1195,20 +1164,17 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
|
||||
// Print offset map
|
||||
//if (MainClass.isDebug)
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "printing partition map");
|
||||
foreach (CommonTypes.Partition partition in partitions)
|
||||
{
|
||||
Console.WriteLine("DEBUG (CDRWin plugin) printing partition map");
|
||||
foreach (CommonTypes.Partition partition in partitions)
|
||||
{
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Partition sequence: {0}", partition.PartitionSequence);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPartition name: {0}", partition.PartitionName);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPartition description: {0}", partition.PartitionDescription);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPartition type: {0}", partition.PartitionType);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPartition starting sector: {0}", partition.PartitionStartSector);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPartition sectors: {0}", partition.PartitionSectors);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPartition starting offset: {0}", partition.PartitionStart);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPartition size in bytes: {0}", partition.PartitionLength);
|
||||
}
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Partition sequence: {0}", partition.PartitionSequence);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPartition name: {0}", partition.PartitionName);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPartition description: {0}", partition.PartitionDescription);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPartition type: {0}", partition.PartitionType);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPartition starting sector: {0}", partition.PartitionStartSector);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPartition sectors: {0}", partition.PartitionSectors);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPartition starting offset: {0}", partition.PartitionStart);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPartition size in bytes: {0}", partition.PartitionLength);
|
||||
}
|
||||
|
||||
foreach (CDRWinTrack track in discimage.tracks)
|
||||
@@ -1313,9 +1279,9 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Exception trying to identify image file {0}", imagePath);
|
||||
Console.WriteLine("Exception: {0}", ex.Message);
|
||||
Console.WriteLine("Stack trace: {0}", ex.StackTrace);
|
||||
DicConsole.ErrorWriteLine("Exception trying to identify image file {0}", imagePath);
|
||||
DicConsole.ErrorWriteLine("Exception: {0}", ex.Message);
|
||||
DicConsole.ErrorWriteLine("Stack trace: {0}", ex.StackTrace);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
2015-10-18 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* VHD.cs:
|
||||
* Nero.cs:
|
||||
* CDRWin.cs:
|
||||
* Apple2MG.cs:
|
||||
* TeleDisk.cs:
|
||||
* DiskCopy42.cs:
|
||||
* DiscImageChef.DiscImages.csproj:
|
||||
Added specific console handling for standard, verbose, debug
|
||||
and error outputs.
|
||||
|
||||
2015-10-05 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* VHD.cs:
|
||||
|
||||
@@ -59,5 +59,9 @@
|
||||
<Project>{F8BDF57B-1571-4CD0-84B3-B422088D359A}</Project>
|
||||
<Name>DiscImageChef.Helpers</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DiscImageChef.Console\DiscImageChef.Console.csproj">
|
||||
<Project>{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}</Project>
|
||||
<Name>DiscImageChef.Console</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -39,6 +39,7 @@ Copyright (C) 2011-2014 Claunia.com
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
@@ -181,18 +182,15 @@ namespace DiscImageChef.ImagePlugins
|
||||
tmp_header.valid = buffer[0x52];
|
||||
tmp_header.reserved = buffer[0x53];
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.diskName = \"{0}\"", tmp_header.diskName);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.dataSize = {0} bytes", tmp_header.dataSize);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.tagSize = {0} bytes", tmp_header.tagSize);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.dataChecksum = 0x{0:X8}", tmp_header.dataChecksum);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.tagChecksum = 0x{0:X8}", tmp_header.tagChecksum);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.format = 0x{0:X2}", tmp_header.format);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.fmtByte = 0x{0:X2}", tmp_header.fmtByte);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.valid = {0}", tmp_header.valid);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.reserved = {0}", tmp_header.reserved);
|
||||
}
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.diskName = \"{0}\"", tmp_header.diskName);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.dataSize = {0} bytes", tmp_header.dataSize);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.tagSize = {0} bytes", tmp_header.tagSize);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.dataChecksum = 0x{0:X8}", tmp_header.dataChecksum);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.tagChecksum = 0x{0:X8}", tmp_header.tagChecksum);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.format = 0x{0:X2}", tmp_header.format);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.fmtByte = 0x{0:X2}", tmp_header.fmtByte);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.valid = {0}", tmp_header.valid);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.reserved = {0}", tmp_header.reserved);
|
||||
|
||||
if (tmp_header.valid != 1 || tmp_header.reserved != 0)
|
||||
return false;
|
||||
@@ -205,8 +203,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
if (tmp_header.format != kSonyFormat400K && tmp_header.format != kSonyFormat800K && tmp_header.format != kSonyFormat720K &&
|
||||
tmp_header.format != kSonyFormat1440K && tmp_header.format != kSonyFormat1680K && tmp_header.format != kSigmaFormatTwiggy)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("Unknown tmp_header.format = 0x{0:X2} value", tmp_header.format);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Unknown tmp_header.format = 0x{0:X2} value", tmp_header.format);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -214,16 +211,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
if (tmp_header.fmtByte != kSonyFmtByte400K && tmp_header.fmtByte != kSonyFmtByte800K && tmp_header.fmtByte != kSonyFmtByte800KIncorrect &&
|
||||
tmp_header.fmtByte != kSonyFmtByteProDos && tmp_header.fmtByte != kInvalidFmtByte && tmp_header.fmtByte != kSigmaFmtByteTwiggy)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("Unknown tmp_header.fmtByte = 0x{0:X2} value", tmp_header.fmtByte);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Unknown tmp_header.fmtByte = 0x{0:X2} value", tmp_header.fmtByte);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tmp_header.fmtByte == kInvalidFmtByte)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("Image says it's unformatted");
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Image says it's unformatted");
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -258,18 +253,15 @@ namespace DiscImageChef.ImagePlugins
|
||||
header.valid = buffer[0x52];
|
||||
header.reserved = buffer[0x53];
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.diskName = \"{0}\"", header.diskName);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.dataSize = {0} bytes", header.dataSize);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.tagSize = {0} bytes", header.tagSize);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.dataChecksum = 0x{0:X8}", header.dataChecksum);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.tagChecksum = 0x{0:X8}", header.tagChecksum);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.format = 0x{0:X2}", header.format);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.fmtByte = 0x{0:X2}", header.fmtByte);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.valid = {0}", header.valid);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.reserved = {0}", header.reserved);
|
||||
}
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.diskName = \"{0}\"", header.diskName);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.dataSize = {0} bytes", header.dataSize);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.tagSize = {0} bytes", header.tagSize);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.dataChecksum = 0x{0:X8}", header.dataChecksum);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.tagChecksum = 0x{0:X8}", header.tagChecksum);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.format = 0x{0:X2}", header.format);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.fmtByte = 0x{0:X2}", header.fmtByte);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.valid = {0}", header.valid);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.reserved = {0}", header.reserved);
|
||||
|
||||
if (header.valid != 1 || header.reserved != 0)
|
||||
return false;
|
||||
@@ -282,8 +274,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
if (header.format != kSonyFormat400K && header.format != kSonyFormat800K && header.format != kSonyFormat720K &&
|
||||
header.format != kSonyFormat1440K && header.format != kSonyFormat1680K && header.format != kSigmaFormatTwiggy)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Unknown header.format = 0x{0:X2} value", header.format);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Unknown header.format = 0x{0:X2} value", header.format);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -291,16 +282,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
if (header.fmtByte != kSonyFmtByte400K && header.fmtByte != kSonyFmtByte800K && header.fmtByte != kSonyFmtByte800KIncorrect &&
|
||||
header.fmtByte != kSonyFmtByteProDos && header.fmtByte != kInvalidFmtByte && header.fmtByte != kSigmaFmtByteTwiggy)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Unknown tmp_header.fmtByte = 0x{0:X2} value", header.fmtByte);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Unknown tmp_header.fmtByte = 0x{0:X2} value", header.fmtByte);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (header.fmtByte == kInvalidFmtByte)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Image says it's unformatted");
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Image says it's unformatted");
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -317,8 +306,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
if (header.tagSize / 12 != ImageInfo.sectors)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.tagSize / 12 != sectors");
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.tagSize / 12 != sectors");
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -398,39 +386,29 @@ namespace DiscImageChef.ImagePlugins
|
||||
UInt32 dataChk;
|
||||
UInt32 tagsChk = 0;
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Reading data");
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Reading data");
|
||||
FileStream datastream = new FileStream(dc42ImagePath, FileMode.Open, FileAccess.Read);
|
||||
datastream.Seek((long)(dataOffset), SeekOrigin.Begin);
|
||||
datastream.Read(data, 0, (int)header.dataSize);
|
||||
datastream.Close();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Calculating data checksum");
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Calculating data checksum");
|
||||
dataChk = DC42CheckSum(data);
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Calculated data checksum = 0x{0:X8}", dataChk);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Stored data checksum = 0x{0:X8}", header.dataChecksum);
|
||||
}
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Calculated data checksum = 0x{0:X8}", dataChk);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Stored data checksum = 0x{0:X8}", header.dataChecksum);
|
||||
|
||||
if (header.tagSize > 0)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Reading tags");
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Reading tags");
|
||||
FileStream tagstream = new FileStream(dc42ImagePath, FileMode.Open, FileAccess.Read);
|
||||
tagstream.Seek((long)(tagOffset), SeekOrigin.Begin);
|
||||
tagstream.Read(tags, 0, (int)header.tagSize);
|
||||
tagstream.Close();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Calculating tag checksum");
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Calculating tag checksum");
|
||||
tagsChk = DC42CheckSum(tags);
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Calculated tag checksum = 0x{0:X8}", tagsChk);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Stored tag checksum = 0x{0:X8}", header.tagChecksum);
|
||||
}
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Calculated tag checksum = 0x{0:X8}", tagsChk);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Stored tag checksum = 0x{0:X8}", header.tagChecksum);
|
||||
}
|
||||
|
||||
return dataChk == header.dataChecksum && tagsChk == header.tagChecksum;
|
||||
|
||||
@@ -38,6 +38,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
@@ -900,14 +901,11 @@ namespace DiscImageChef.ImagePlugins
|
||||
footerV2.ChunkID = BigEndianBitConverter.ToUInt32(buffer, 0);
|
||||
footerV2.FirstChunkOffset = BigEndianBitConverter.ToUInt64(buffer, 4);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): imageInfo.Length = {0}", imageInfo.Length);
|
||||
Console.WriteLine("DEBUG (Nero plugin): footerV1.ChunkID = 0x{0:X2} (\"{1}\")", footerV1.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV1.ChunkID)));
|
||||
Console.WriteLine("DEBUG (Nero plugin): footerV1.FirstChunkOffset = {0}", footerV1.FirstChunkOffset);
|
||||
Console.WriteLine("DEBUG (Nero plugin): footerV2.ChunkID = 0x{0:X2} (\"{1}\")", footerV2.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV2.ChunkID)));
|
||||
Console.WriteLine("DEBUG (Nero plugin): footerV2.FirstChunkOffset = {0}", footerV2.FirstChunkOffset);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "imageInfo.Length = {0}", imageInfo.Length);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "footerV1.ChunkID = 0x{0:X2} (\"{1}\")", footerV1.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV1.ChunkID)));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "footerV1.FirstChunkOffset = {0}", footerV1.FirstChunkOffset);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "footerV2.ChunkID = 0x{0:X2} (\"{1}\")", footerV2.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV2.ChunkID)));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "footerV2.FirstChunkOffset = {0}", footerV2.FirstChunkOffset);
|
||||
|
||||
if (footerV2.ChunkID == NeroV2FooterID && footerV2.FirstChunkOffset < (ulong)imageInfo.Length)
|
||||
{
|
||||
@@ -948,14 +946,11 @@ namespace DiscImageChef.ImagePlugins
|
||||
footerV2.ChunkID = BigEndianBitConverter.ToUInt32(buffer, 0);
|
||||
footerV2.FirstChunkOffset = BigEndianBitConverter.ToUInt64(buffer, 4);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): imageInfo.Length = {0}", imageInfo.Length);
|
||||
Console.WriteLine("DEBUG (Nero plugin): footerV1.ChunkID = 0x{0:X2} (\"{1}\")", footerV1.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV1.ChunkID)));
|
||||
Console.WriteLine("DEBUG (Nero plugin): footerV1.FirstChunkOffset = {0}", footerV1.FirstChunkOffset);
|
||||
Console.WriteLine("DEBUG (Nero plugin): footerV2.ChunkID = 0x{0:X2} (\"{1}\")", footerV2.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV2.ChunkID)));
|
||||
Console.WriteLine("DEBUG (Nero plugin): footerV2.FirstChunkOffset = {0}", footerV2.FirstChunkOffset);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "imageInfo.Length = {0}", imageInfo.Length);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "footerV1.ChunkID = 0x{0:X2} (\"{1}\")", footerV1.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV1.ChunkID)));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "footerV1.FirstChunkOffset = {0}", footerV1.FirstChunkOffset);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "footerV2.ChunkID = 0x{0:X2} (\"{1}\")", footerV2.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV2.ChunkID)));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "footerV2.FirstChunkOffset = {0}", footerV2.FirstChunkOffset);
|
||||
|
||||
if (footerV1.ChunkID == NeroV1FooterID && footerV1.FirstChunkOffset < (ulong)imageInfo.Length)
|
||||
imageNewFormat = false;
|
||||
@@ -993,18 +988,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
ChunkID = BigEndianBitConverter.ToUInt32(ChunkHeaderBuffer, 0);
|
||||
ChunkLength = BigEndianBitConverter.ToUInt32(ChunkHeaderBuffer, 4);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): ChunkID = 0x{0:X2} (\"{1}\")", ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(ChunkID)));
|
||||
Console.WriteLine("DEBUG (Nero plugin): ChunkLength = {0}", ChunkLength);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "ChunkID = 0x{0:X2} (\"{1}\")", ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(ChunkID)));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "ChunkLength = {0}", ChunkLength);
|
||||
|
||||
switch (ChunkID)
|
||||
{
|
||||
case NeroV1CUEID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"CUES\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"CUES\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroCuesheetV1 = new NeroV1Cuesheet();
|
||||
neroCuesheetV1.ChunkID = ChunkID;
|
||||
@@ -1024,17 +1015,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
_entry.Second = tmpbuffer[6];
|
||||
_entry.Frame = tmpbuffer[7];
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): Cuesheet entry {0}", (i / 8) + 1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Mode = {1:X2}", (i / 8) + 1, _entry.Mode);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].TrackNumber = {1:X2}", (i / 8) + 1, _entry.TrackNumber);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].IndexNumber = {1:X2}", (i / 8) + 1, _entry.IndexNumber);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Dummy = {1:X4}", (i / 8) + 1, _entry.Dummy);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Minute = {1:X2}", (i / 8) + 1, _entry.Minute);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Second = {1:X2}", (i / 8) + 1, _entry.Second);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Frame = {1:X2}", (i / 8) + 1, _entry.Frame);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Cuesheet entry {0}", (i / 8) + 1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Mode = {1:X2}", (i / 8) + 1, _entry.Mode);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].TrackNumber = {1:X2}", (i / 8) + 1, _entry.TrackNumber);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].IndexNumber = {1:X2}", (i / 8) + 1, _entry.IndexNumber);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Dummy = {1:X4}", (i / 8) + 1, _entry.Dummy);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Minute = {1:X2}", (i / 8) + 1, _entry.Minute);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Second = {1:X2}", (i / 8) + 1, _entry.Second);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Frame = {1:X2}", (i / 8) + 1, _entry.Frame);
|
||||
|
||||
neroCuesheetV1.Entries.Add(_entry);
|
||||
}
|
||||
@@ -1043,8 +1031,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case NeroV2CUEID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"CUEX\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"CUEX\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroCuesheetV2 = new NeroV2Cuesheet();
|
||||
neroCuesheetV2.ChunkID = ChunkID;
|
||||
@@ -1062,15 +1049,12 @@ namespace DiscImageChef.ImagePlugins
|
||||
_entry.Dummy = tmpbuffer[3];
|
||||
_entry.LBAStart = BigEndianBitConverter.ToInt32(tmpbuffer, 4);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): Cuesheet entry {0}", (i / 8) + 1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Mode = 0x{1:X2}", (i / 8) + 1, _entry.Mode);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].TrackNumber = {1:X2}", (i / 8) + 1, _entry.TrackNumber);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].IndexNumber = {1:X2}", (i / 8) + 1, _entry.IndexNumber);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Dummy = {1:X2}", (i / 8) + 1, _entry.Dummy);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].LBAStart = {1}", (i / 8) + 1, _entry.LBAStart);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Cuesheet entry {0}", (i / 8) + 1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Mode = 0x{1:X2}", (i / 8) + 1, _entry.Mode);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].TrackNumber = {1:X2}", (i / 8) + 1, _entry.TrackNumber);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].IndexNumber = {1:X2}", (i / 8) + 1, _entry.IndexNumber);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Dummy = {1:X2}", (i / 8) + 1, _entry.Dummy);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].LBAStart = {1}", (i / 8) + 1, _entry.LBAStart);
|
||||
|
||||
neroCuesheetV2.Entries.Add(_entry);
|
||||
}
|
||||
@@ -1079,8 +1063,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case NeroV1DAOID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"DAOI\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"DAOI\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroDAOV1 = new NeroV1DAO();
|
||||
neroDAOV1.ChunkID = ChunkID;
|
||||
@@ -1102,14 +1085,11 @@ namespace DiscImageChef.ImagePlugins
|
||||
if (!ImageInfo.readableSectorTags.Contains(SectorTagType.CDTrackISRC))
|
||||
ImageInfo.readableSectorTags.Add(SectorTagType.CDTrackISRC);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV1.ChunkSizeLe = {0} bytes", neroDAOV1.ChunkSizeLe);
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV1.UPC = \"{0}\"", StringHandlers.CToString(neroDAOV1.UPC));
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV1.TocType = 0x{0:X4}", neroDAOV1.TocType);
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV1.FirstTrack = {0}", neroDAOV1.FirstTrack);
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV1.LastTrack = {0}", neroDAOV1.LastTrack);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV1.ChunkSizeLe = {0} bytes", neroDAOV1.ChunkSizeLe);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV1.UPC = \"{0}\"", StringHandlers.CToString(neroDAOV1.UPC));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV1.TocType = 0x{0:X4}", neroDAOV1.TocType);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV1.FirstTrack = {0}", neroDAOV1.FirstTrack);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV1.LastTrack = {0}", neroDAOV1.LastTrack);
|
||||
|
||||
UPC = neroDAOV1.UPC;
|
||||
|
||||
@@ -1127,17 +1107,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
_entry.Index1 = BigEndianBitConverter.ToUInt32(tmpbuffer, 22);
|
||||
_entry.EndOfTrack = BigEndianBitConverter.ToUInt32(tmpbuffer, 26);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): Disc-At-Once entry {0}", (i / 32) + 1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].ISRC = \"{1}\"", (i / 32) + 1, StringHandlers.CToString(_entry.ISRC));
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].SectorSize = {1}", (i / 32) + 1, _entry.SectorSize);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Mode = {1} (0x{2:X4})", (i / 32) + 1, (DAOMode)_entry.Mode, _entry.Mode);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Unknown = 0x{1:X4}", (i / 32) + 1, _entry.Unknown);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Index0 = {1}", (i / 32) + 1, _entry.Index0);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Index1 = {1}", (i / 32) + 1, _entry.Index1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].EndOfTrack = {1}", (i / 32) + 1, _entry.EndOfTrack);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Disc-At-Once entry {0}", (i / 32) + 1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].ISRC = \"{1}\"", (i / 32) + 1, StringHandlers.CToString(_entry.ISRC));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].SectorSize = {1}", (i / 32) + 1, _entry.SectorSize);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Mode = {1} (0x{2:X4})", (i / 32) + 1, (DAOMode)_entry.Mode, _entry.Mode);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Unknown = 0x{1:X4}", (i / 32) + 1, _entry.Unknown);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Index0 = {1}", (i / 32) + 1, _entry.Index0);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Index1 = {1}", (i / 32) + 1, _entry.Index1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].EndOfTrack = {1}", (i / 32) + 1, _entry.EndOfTrack);
|
||||
|
||||
neroDAOV1.Tracks.Add(_entry);
|
||||
|
||||
@@ -1169,8 +1146,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case NeroV2DAOID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"DAOX\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"DAOX\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroDAOV2 = new NeroV2DAO();
|
||||
neroDAOV2.ChunkID = ChunkID;
|
||||
@@ -1194,14 +1170,11 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
UPC = neroDAOV2.UPC;
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV2.ChunkSizeLe = {0} bytes", neroDAOV2.ChunkSizeLe);
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV2.UPC = \"{0}\"", StringHandlers.CToString(neroDAOV2.UPC));
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV2.TocType = 0x{0:X4}", neroDAOV2.TocType);
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV2.FirstTrack = {0}", neroDAOV2.FirstTrack);
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV2.LastTrack = {0}", neroDAOV2.LastTrack);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV2.ChunkSizeLe = {0} bytes", neroDAOV2.ChunkSizeLe);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV2.UPC = \"{0}\"", StringHandlers.CToString(neroDAOV2.UPC));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV2.TocType = 0x{0:X4}", neroDAOV2.TocType);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV2.FirstTrack = {0}", neroDAOV2.FirstTrack);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV2.LastTrack = {0}", neroDAOV2.LastTrack);
|
||||
|
||||
tmpbuffer = new byte[42];
|
||||
for (int i = 0; i < (neroDAOV2.ChunkSizeBe - 22); i += 42)
|
||||
@@ -1217,17 +1190,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
_entry.Index1 = BigEndianBitConverter.ToUInt64(tmpbuffer, 26);
|
||||
_entry.EndOfTrack = BigEndianBitConverter.ToUInt64(tmpbuffer, 34);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): Disc-At-Once entry {0}", (i / 32) + 1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].ISRC = \"{1}\"", (i / 32) + 1, StringHandlers.CToString(_entry.ISRC));
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].SectorSize = {1}", (i / 32) + 1, _entry.SectorSize);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Mode = {1} (0x{2:X4})", (i / 32) + 1, (DAOMode)_entry.Mode, _entry.Mode);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Unknown = {1:X2}", (i / 32) + 1, _entry.Unknown);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Index0 = {1}", (i / 32) + 1, _entry.Index0);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Index1 = {1}", (i / 32) + 1, _entry.Index1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].EndOfTrack = {1}", (i / 32) + 1, _entry.EndOfTrack);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Disc-At-Once entry {0}", (i / 32) + 1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].ISRC = \"{1}\"", (i / 32) + 1, StringHandlers.CToString(_entry.ISRC));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].SectorSize = {1}", (i / 32) + 1, _entry.SectorSize);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Mode = {1} (0x{2:X4})", (i / 32) + 1, (DAOMode)_entry.Mode, _entry.Mode);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Unknown = {1:X2}", (i / 32) + 1, _entry.Unknown);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Index0 = {1}", (i / 32) + 1, _entry.Index0);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Index1 = {1}", (i / 32) + 1, _entry.Index1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].EndOfTrack = {1}", (i / 32) + 1, _entry.EndOfTrack);
|
||||
|
||||
neroDAOV2.Tracks.Add(_entry);
|
||||
|
||||
@@ -1259,8 +1229,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case NeroCDTextID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"CDTX\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"CDTX\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroCDTXT = new NeroCDText();
|
||||
neroCDTXT.ChunkID = ChunkID;
|
||||
@@ -1281,16 +1250,13 @@ namespace DiscImageChef.ImagePlugins
|
||||
Array.Copy(tmpbuffer, 4, _entry.Text, 0, 12);
|
||||
_entry.CRC = BigEndianBitConverter.ToUInt16(tmpbuffer, 16);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): CD-TEXT entry {0}", (i / 18) + 1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].PackType = 0x{1:X2}", (i / 18) + 1, _entry.PackType);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].TrackNumber = 0x{1:X2}", (i / 18) + 1, _entry.TrackNumber);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].PackNumber = 0x{1:X2}", (i / 18) + 1, _entry.PackNumber);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].BlockNumber = 0x{1:X2}", (i / 18) + 1, _entry.BlockNumber);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Text = \"{1}\"", (i / 18) + 1, StringHandlers.CToString(_entry.Text));
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].CRC = 0x{1:X4}", (i / 18) + 1, _entry.CRC);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "CD-TEXT entry {0}", (i / 18) + 1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].PackType = 0x{1:X2}", (i / 18) + 1, _entry.PackType);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].TrackNumber = 0x{1:X2}", (i / 18) + 1, _entry.TrackNumber);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].PackNumber = 0x{1:X2}", (i / 18) + 1, _entry.PackNumber);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].BlockNumber = 0x{1:X2}", (i / 18) + 1, _entry.BlockNumber);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Text = \"{1}\"", (i / 18) + 1, StringHandlers.CToString(_entry.Text));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].CRC = 0x{1:X4}", (i / 18) + 1, _entry.CRC);
|
||||
|
||||
neroCDTXT.Packs.Add(_entry);
|
||||
}
|
||||
@@ -1299,8 +1265,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case NeroV1TAOID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"ETNF\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"ETNF\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroTAOV1 = new NeroV1TAO();
|
||||
neroTAOV1.ChunkID = ChunkID;
|
||||
@@ -1319,15 +1284,12 @@ namespace DiscImageChef.ImagePlugins
|
||||
_entry.StartLBA = BigEndianBitConverter.ToUInt32(tmpbuffer, 12);
|
||||
_entry.Unknown = BigEndianBitConverter.ToUInt32(tmpbuffer, 16);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): Track-at-Once entry {0}", (i / 20) + 1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Offset = {1}", (i / 20) + 1, _entry.Offset);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Length = {1} bytes", (i / 20) + 1, _entry.Length);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Mode = {1} (0x{2:X4})", (i / 20) + 1, (DAOMode)_entry.Mode, _entry.Mode);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].StartLBA = {1}", (i / 20) + 1, _entry.StartLBA);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Unknown = 0x{1:X4}", (i / 20) + 1, _entry.Unknown);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Track-at-Once entry {0}", (i / 20) + 1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Offset = {1}", (i / 20) + 1, _entry.Offset);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Length = {1} bytes", (i / 20) + 1, _entry.Length);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Mode = {1} (0x{2:X4})", (i / 20) + 1, (DAOMode)_entry.Mode, _entry.Mode);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].StartLBA = {1}", (i / 20) + 1, _entry.StartLBA);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Unknown = 0x{1:X4}", (i / 20) + 1, _entry.Unknown);
|
||||
|
||||
neroTAOV1.Tracks.Add(_entry);
|
||||
|
||||
@@ -1357,8 +1319,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case NeroV2TAOID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"ETN2\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"ETN2\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroTAOV2 = new NeroV2TAO();
|
||||
neroTAOV2.ChunkID = ChunkID;
|
||||
@@ -1378,16 +1339,13 @@ namespace DiscImageChef.ImagePlugins
|
||||
_entry.Unknown = BigEndianBitConverter.ToUInt32(tmpbuffer, 24);
|
||||
_entry.Sectors = BigEndianBitConverter.ToUInt32(tmpbuffer, 28);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): Track-at-Once entry {0}", (i / 32) + 1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Offset = {1}", (i / 32) + 1, _entry.Offset);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Length = {1} bytes", (i / 32) + 1, _entry.Length);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Mode = {1} (0x{2:X4})", (i / 32) + 1, (DAOMode)_entry.Mode, _entry.Mode);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].StartLBA = {1}", (i / 32) + 1, _entry.StartLBA);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Unknown = 0x{1:X4}", (i / 32) + 1, _entry.Unknown);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Sectors = {1}", (i / 32) + 1, _entry.Sectors);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Track-at-Once entry {0}", (i / 32) + 1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Offset = {1}", (i / 32) + 1, _entry.Offset);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Length = {1} bytes", (i / 32) + 1, _entry.Length);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Mode = {1} (0x{2:X4})", (i / 32) + 1, (DAOMode)_entry.Mode, _entry.Mode);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].StartLBA = {1}", (i / 32) + 1, _entry.StartLBA);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Unknown = 0x{1:X4}", (i / 32) + 1, _entry.Unknown);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Sectors = {1}", (i / 32) + 1, _entry.Sectors);
|
||||
|
||||
neroTAOV2.Tracks.Add(_entry);
|
||||
|
||||
@@ -1417,8 +1375,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case NeroSessionID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"SINF\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"SINF\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
UInt32 sessionTracks;
|
||||
byte[] tmpbuffer = new byte[4];
|
||||
@@ -1426,16 +1383,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
sessionTracks = BigEndianBitConverter.ToUInt32(tmpbuffer, 0);
|
||||
neroSessions.Add(currentsession, sessionTracks);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): \tSession {0} has {1} tracks", currentsession, sessionTracks);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tSession {0} has {1} tracks", currentsession, sessionTracks);
|
||||
|
||||
currentsession++;
|
||||
break;
|
||||
}
|
||||
case NeroDiskTypeID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"MTYP\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"MTYP\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroMediaTyp = new NeroMediaType();
|
||||
|
||||
@@ -1446,8 +1401,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
imageStream.Read(tmpbuffer, 0, 4);
|
||||
neroMediaTyp.Type = BigEndianBitConverter.ToUInt32(tmpbuffer, 0);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): \tMedia type is {0} ({1})", (NeroMediaTypes)neroMediaTyp.Type, neroMediaTyp.Type);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tMedia type is {0} ({1})", (NeroMediaTypes)neroMediaTyp.Type, neroMediaTyp.Type);
|
||||
|
||||
ImageInfo.diskType = NeroMediaTypeToDiskType((NeroMediaTypes)neroMediaTyp.Type);
|
||||
|
||||
@@ -1455,8 +1409,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case NeroDiscInfoID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"DINF\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"DINF\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroDiscInfo = new NeroDiscInformation();
|
||||
neroDiscInfo.ChunkID = ChunkID;
|
||||
@@ -1465,15 +1418,13 @@ namespace DiscImageChef.ImagePlugins
|
||||
imageStream.Read(tmpbuffer, 0, 4);
|
||||
neroDiscInfo.Unknown = BigEndianBitConverter.ToUInt32(tmpbuffer, 0);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): \tneroDiscInfo.Unknown = 0x{0:X4} ({0})", neroDiscInfo.Unknown);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tneroDiscInfo.Unknown = 0x{0:X4} ({0})", neroDiscInfo.Unknown);
|
||||
|
||||
break;
|
||||
}
|
||||
case NeroReloID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"RELO\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"RELO\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroRELO = new NeroRELOChunk();
|
||||
neroRELO.ChunkID = ChunkID;
|
||||
@@ -1482,15 +1433,13 @@ namespace DiscImageChef.ImagePlugins
|
||||
imageStream.Read(tmpbuffer, 0, 4);
|
||||
neroRELO.Unknown = BigEndianBitConverter.ToUInt32(tmpbuffer, 0);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): \tneroRELO.Unknown = 0x{0:X4} ({0})", neroRELO.Unknown);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tneroRELO.Unknown = 0x{0:X4} ({0})", neroRELO.Unknown);
|
||||
|
||||
break;
|
||||
}
|
||||
case NeroTOCID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"TOCT\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"TOCT\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroTOC = new NeroTOCChunk();
|
||||
neroTOC.ChunkID = ChunkID;
|
||||
@@ -1499,22 +1448,19 @@ namespace DiscImageChef.ImagePlugins
|
||||
imageStream.Read(tmpbuffer, 0, 2);
|
||||
neroTOC.Unknown = BigEndianBitConverter.ToUInt16(tmpbuffer, 0);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): \tneroTOC.Unknown = 0x{0:X4} ({0})", neroTOC.Unknown);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tneroTOC.Unknown = 0x{0:X4} ({0})", neroTOC.Unknown);
|
||||
|
||||
break;
|
||||
}
|
||||
case NeroEndID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"END!\" chunk, finishing parse");
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"END!\" chunk, finishing parse");
|
||||
parsing = false;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Unknown chunk ID \"{0}\", skipping...", System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(ChunkID)));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Unknown chunk ID \"{0}\", skipping...", System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(ChunkID)));
|
||||
imageStream.Seek(ChunkLength, SeekOrigin.Current);
|
||||
break;
|
||||
}
|
||||
@@ -1556,8 +1502,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
if (neroSessions.Count == 0)
|
||||
neroSessions.Add(1, currenttrack);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Building offset, track and session maps");
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Building offset, track and session maps");
|
||||
|
||||
currentsession = 1;
|
||||
uint currentsessionmaxtrack;
|
||||
@@ -1570,12 +1515,9 @@ namespace DiscImageChef.ImagePlugins
|
||||
NeroTrack _neroTrack;
|
||||
if (neroTracks.TryGetValue(i, out _neroTrack))
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): \tcurrentsession = {0}", currentsession);
|
||||
Console.WriteLine("DEBUG (Nero plugin): \tcurrentsessionmaxtrack = {0}", currentsessionmaxtrack);
|
||||
Console.WriteLine("DEBUG (Nero plugin): \tcurrentsessioncurrenttrack = {0}", currentsessioncurrenttrack);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tcurrentsession = {0}", currentsession);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tcurrentsessionmaxtrack = {0}", currentsessionmaxtrack);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tcurrentsessioncurrenttrack = {0}", currentsessioncurrenttrack);
|
||||
|
||||
Track _track = new Track();
|
||||
_track.Indexes = new Dictionary<int, ulong>();
|
||||
@@ -1591,16 +1533,13 @@ namespace DiscImageChef.ImagePlugins
|
||||
_track.TrackType = NeroTrackModeToTrackType((DAOMode)_neroTrack.Mode);
|
||||
imageTracks.Add(_track);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackDescription = {0}", _track.TrackDescription);
|
||||
Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackEndSector = {0}", _track.TrackEndSector);
|
||||
Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackPregap = {0}", _track.TrackPregap);
|
||||
Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackSequence = {0}", _track.TrackSequence);
|
||||
Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackSession = {0}", _track.TrackSession);
|
||||
Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackStartSector = {0}", _track.TrackStartSector);
|
||||
Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackType = {0}", _track.TrackType);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackDescription = {0}", _track.TrackDescription);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackEndSector = {0}", _track.TrackEndSector);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackPregap = {0}", _track.TrackPregap);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackSequence = {0}", _track.TrackSequence);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackSession = {0}", _track.TrackSession);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackStartSector = {0}", _track.TrackStartSector);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackType = {0}", _track.TrackType);
|
||||
|
||||
if (currentsessioncurrenttrack == 1)
|
||||
{
|
||||
@@ -1621,8 +1560,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
|
||||
offsetmap.Add(_track.TrackSequence, _track.TrackStartSector);
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): \t\t Offset[{0}]: {1}", _track.TrackSequence, _track.TrackStartSector);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t Offset[{0}]: {1}", _track.TrackSequence, _track.TrackStartSector);
|
||||
|
||||
CommonTypes.Partition partition;
|
||||
|
||||
|
||||
@@ -42,6 +42,9 @@ using System.Collections.Generic;
|
||||
|
||||
// Created following notes from Dave Dunfield
|
||||
// http://www.classiccmp.org/dunfield/img54306/td0notes.txt
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
class TeleDisk : ImagePlugin
|
||||
@@ -255,20 +258,17 @@ namespace DiscImageChef.ImagePlugins
|
||||
Array.Copy(headerBytes, headerBytesForCRC, 10);
|
||||
UInt16 calculatedHeaderCRC = TeleDiskCRC(0x0000, headerBytesForCRC);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.signature = 0x{0:X4}", header.signature);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.sequence = 0x{0:X2}", header.sequence);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.diskSet = 0x{0:X2}", header.diskSet);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.version = 0x{0:X2}", header.version);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.dataRate = 0x{0:X2}", header.dataRate);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.driveType = 0x{0:X2}", header.driveType);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.stepping = 0x{0:X2}", header.stepping);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.dosAllocation = 0x{0:X2}", header.dosAllocation);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.sides = 0x{0:X2}", header.sides);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.crc = 0x{0:X4}", header.crc);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): calculated header crc = 0x{0:X4}", calculatedHeaderCRC);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.signature = 0x{0:X4}", header.signature);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.sequence = 0x{0:X2}", header.sequence);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.diskSet = 0x{0:X2}", header.diskSet);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.version = 0x{0:X2}", header.version);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.dataRate = 0x{0:X2}", header.dataRate);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.driveType = 0x{0:X2}", header.driveType);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.stepping = 0x{0:X2}", header.stepping);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.dosAllocation = 0x{0:X2}", header.dosAllocation);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.sides = 0x{0:X2}", header.sides);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.crc = 0x{0:X4}", header.crc);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "calculated header crc = 0x{0:X4}", calculatedHeaderCRC);
|
||||
|
||||
// We need more checks as the magic is too simply.
|
||||
// This may deny legal images
|
||||
@@ -321,21 +321,18 @@ namespace DiscImageChef.ImagePlugins
|
||||
Array.Copy(headerBytes, headerBytesForCRC, 10);
|
||||
UInt16 calculatedHeaderCRC = TeleDiskCRC(0x0000, headerBytesForCRC);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.signature = 0x{0:X4}", header.signature);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.sequence = 0x{0:X2}", header.sequence);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.diskSet = 0x{0:X2}", header.diskSet);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.version = 0x{0:X2}", header.version);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.dataRate = 0x{0:X2}", header.dataRate);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.driveType = 0x{0:X2}", header.driveType);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.stepping = 0x{0:X2}", header.stepping);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.dosAllocation = 0x{0:X2}", header.dosAllocation);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.sides = 0x{0:X2}", header.sides);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.crc = 0x{0:X4}", header.crc);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): calculated header crc = 0x{0:X4}", calculatedHeaderCRC);
|
||||
}
|
||||
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.signature = 0x{0:X4}", header.signature);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.sequence = 0x{0:X2}", header.sequence);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.diskSet = 0x{0:X2}", header.diskSet);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.version = 0x{0:X2}", header.version);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.dataRate = 0x{0:X2}", header.dataRate);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.driveType = 0x{0:X2}", header.driveType);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.stepping = 0x{0:X2}", header.stepping);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.dosAllocation = 0x{0:X2}", header.dosAllocation);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.sides = 0x{0:X2}", header.sides);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.crc = 0x{0:X4}", header.crc);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "calculated header crc = 0x{0:X4}", calculatedHeaderCRC);
|
||||
|
||||
// We need more checks as the magic is too simply.
|
||||
// This may deny legal images
|
||||
|
||||
@@ -343,8 +340,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
if (header.crc != calculatedHeaderCRC)
|
||||
{
|
||||
ADiskCRCHasFailed = true;
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Calculated CRC does not coincide with stored one.");
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Calculated CRC does not coincide with stored one.");
|
||||
}
|
||||
|
||||
if (header.sequence != 0x00)
|
||||
@@ -388,19 +384,16 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
UInt16 cmtcrc = TeleDiskCRC(0, commentBlockForCRC);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Comment header");
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.crc = 0x{0:X4}", commentHeader.crc);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tCalculated CRC = 0x{0:X4}", cmtcrc);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.length = {0} bytes", commentHeader.length);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.year = {0}", commentHeader.year);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.month = {0}", commentHeader.month);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.day = {0}", commentHeader.day);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.hour = {0}", commentHeader.hour);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.minute = {0}", commentHeader.minute);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.second = {0}", commentHeader.second);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Comment header");
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tcommentheader.crc = 0x{0:X4}", commentHeader.crc);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tCalculated CRC = 0x{0:X4}", cmtcrc);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tcommentheader.length = {0} bytes", commentHeader.length);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tcommentheader.year = {0}", commentHeader.year);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tcommentheader.month = {0}", commentHeader.month);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tcommentheader.day = {0}", commentHeader.day);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tcommentheader.hour = {0}", commentHeader.hour);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tcommentheader.minute = {0}", commentHeader.minute);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tcommentheader.second = {0}", commentHeader.second);
|
||||
|
||||
ADiskCRCHasFailed |= cmtcrc != commentHeader.crc;
|
||||
|
||||
@@ -413,11 +406,8 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
ImageInfo.imageComments = System.Text.Encoding.ASCII.GetString(commentBlock);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Comment");
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): {0}", ImageInfo.imageComments);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Comment");
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "{0}", ImageInfo.imageComments);
|
||||
|
||||
ImageInfo.imageCreationTime = new DateTime(commentHeader.year + 1900, commentHeader.month + 1, commentHeader.day,
|
||||
commentHeader.hour, commentHeader.minute, commentHeader.second, DateTimeKind.Unspecified);
|
||||
@@ -428,14 +418,10 @@ namespace DiscImageChef.ImagePlugins
|
||||
ImageInfo.imageCreationTime = fi.CreationTimeUtc;
|
||||
ImageInfo.imageLastModificationTime = fi.LastWriteTimeUtc;
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Image created on {0}", ImageInfo.imageCreationTime);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Image modified on {0}", ImageInfo.imageLastModificationTime);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Image created on {0}", ImageInfo.imageCreationTime);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Image modified on {0}", ImageInfo.imageLastModificationTime);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Parsing image");
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Parsing image");
|
||||
|
||||
totalDiskSize = 0;
|
||||
byte spt = 0;
|
||||
@@ -459,24 +445,18 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
TDTrackCalculatedCRC = (byte)(TeleDiskCRC(0, TDTrackForCRC) & 0xFF);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Track follows");
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tTrack cylinder: {0}\t", TDTrack.cylinder);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tTrack head: {0}\t", TDTrack.head);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tSectors in track: {0}\t", TDTrack.sectors);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tTrack header CRC: 0x{0:X2} (calculated 0x{1:X2})\t", TDTrack.crc, TDTrackCalculatedCRC);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Track follows");
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tTrack cylinder: {0}\t", TDTrack.cylinder);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tTrack head: {0}\t", TDTrack.head);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tSectors in track: {0}\t", TDTrack.sectors);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tTrack header CRC: 0x{0:X2} (calculated 0x{1:X2})\t", TDTrack.crc, TDTrackCalculatedCRC);
|
||||
|
||||
ADiskCRCHasFailed |= TDTrackCalculatedCRC != TDTrack.crc;
|
||||
|
||||
if (TDTrack.sectors == 0xFF) // End of disk image
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): End of disk image arrived");
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Total of {0} data sectors, for {1} bytes", sectorsData.Count, totalDiskSize);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "End of disk image arrived");
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Total of {0} data sectors, for {1} bytes", sectorsData.Count, totalDiskSize);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -503,16 +483,13 @@ namespace DiscImageChef.ImagePlugins
|
||||
TDSector.flags = (byte)stream.ReadByte();
|
||||
TDSector.crc = (byte)stream.ReadByte();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tSector follows");
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tAddressMark cylinder: {0}", TDSector.cylinder);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tAddressMark head: {0}", TDSector.head);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tAddressMark sector number: {0}", TDSector.sectorNumber);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tSector size: {0}", TDSector.sectorSize);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tSector flags: 0x{0:X2}", TDSector.flags);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tSector CRC (plus headers): 0x{0:X2}", TDSector.crc);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tSector follows");
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tAddressMark cylinder: {0}", TDSector.cylinder);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tAddressMark head: {0}", TDSector.head);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tAddressMark sector number: {0}", TDSector.sectorNumber);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tSector size: {0}", TDSector.sectorSize);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tSector flags: 0x{0:X2}", TDSector.flags);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tSector CRC (plus headers): 0x{0:X2}", TDSector.crc);
|
||||
|
||||
UInt32 LBA = (uint)((TDSector.cylinder * header.sides * spt) + (TDSector.head * spt) + (TDSector.sectorNumber - 1));
|
||||
if ((TDSector.flags & FlagsSectorDataless) != FlagsSectorDataless && (TDSector.flags & FlagsSectorSkipped) != FlagsSectorSkipped)
|
||||
@@ -524,11 +501,8 @@ namespace DiscImageChef.ImagePlugins
|
||||
TDData.dataEncoding = (byte)stream.ReadByte();
|
||||
data = new byte[TDData.dataSize];
|
||||
stream.Read(data, 0, TDData.dataSize);
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tData size (in-image): {0}", TDData.dataSize);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tData encoding: 0x{0:X2}", TDData.dataEncoding);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tData size (in-image): {0}", TDData.dataSize);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tData encoding: 0x{0:X2}", TDData.dataEncoding);
|
||||
|
||||
decodedData = DecodeTeleDiskData(TDSector.sectorSize, TDData.dataEncoding, data);
|
||||
|
||||
@@ -536,8 +510,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
if (TDSectorCalculatedCRC != TDSector.crc)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Sector LBA {0} calculated CRC 0x{1:X2} differs from stored CRC 0x{2:X2}", LBA, TDSectorCalculatedCRC, TDSector.crc);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Sector LBA {0} calculated CRC 0x{1:X2} differs from stored CRC 0x{2:X2}", LBA, TDSectorCalculatedCRC, TDSector.crc);
|
||||
if ((TDSector.flags & FlagsSectorNoID) != FlagsSectorNoID)
|
||||
if (!sectorsData.ContainsKey(LBA) && (TDSector.flags & FlagsSectorDuplicate) != FlagsSectorDuplicate)
|
||||
SectorsWhereCRCHasFailed.Add((UInt64)LBA);
|
||||
@@ -574,8 +547,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
ArrayHelpers.ArrayFill(decodedData, (byte)0);
|
||||
}
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tLBA: {0}", LBA);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tLBA: {0}", LBA);
|
||||
|
||||
if ((TDSector.flags & FlagsSectorNoID) != FlagsSectorNoID)
|
||||
{
|
||||
@@ -583,15 +555,13 @@ namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
if ((TDSector.flags & FlagsSectorDuplicate) == FlagsSectorDuplicate)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tSector {0} on cylinder {1} head {2} is duplicate, and marked so",
|
||||
TDSector.sectorNumber, TDSector.cylinder, TDSector.head);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tSector {0} on cylinder {1} head {2} is duplicate, and marked so",
|
||||
TDSector.sectorNumber, TDSector.cylinder, TDSector.head);
|
||||
}
|
||||
else
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tSector {0} on cylinder {1} head {2} is duplicate, but is not marked so",
|
||||
TDSector.sectorNumber, TDSector.cylinder, TDSector.head);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tSector {0} on cylinder {1} head {2} is duplicate, but is not marked so",
|
||||
TDSector.sectorNumber, TDSector.cylinder, TDSector.head);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -840,13 +810,11 @@ namespace DiscImageChef.ImagePlugins
|
||||
ins += 4;
|
||||
outs += decodedPiece.Length;
|
||||
}
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): (Block pattern decoder): Input data size: {0} bytes", encodedData.Length);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): (Block pattern decoder): Processed input: {0} bytes", ins);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): (Block pattern decoder): Output data size: {0} bytes", decodedData.Length);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): (Block pattern decoder): Processed Output: {0} bytes", outs);
|
||||
}
|
||||
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "(Block pattern decoder): Input data size: {0} bytes", encodedData.Length);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "(Block pattern decoder): Processed input: {0} bytes", ins);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "(Block pattern decoder): Output data size: {0} bytes", decodedData.Length);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "(Block pattern decoder): Processed Output: {0} bytes", outs);
|
||||
break;
|
||||
}
|
||||
case dataBlockRLE:
|
||||
@@ -881,13 +849,12 @@ namespace DiscImageChef.ImagePlugins
|
||||
outs += Piece.Length;
|
||||
}
|
||||
}
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): (RLE decoder): Input data size: {0} bytes", encodedData.Length);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): (RLE decoder): Processed input: {0} bytes", ins);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): (RLE decoder): Output data size: {0} bytes", decodedData.Length);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): (RLE decoder): Processed Output: {0} bytes", outs);
|
||||
}
|
||||
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "(RLE decoder): Input data size: {0} bytes", encodedData.Length);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "(RLE decoder): Processed input: {0} bytes", ins);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "(RLE decoder): Output data size: {0} bytes", decodedData.Length);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "(RLE decoder): Processed Output: {0} bytes", outs);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -967,8 +934,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
return DiskType.ECMA_78_2;
|
||||
default:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 5,25\" disk with {0} bytes", totalDiskSize);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Unknown 5,25\" disk with {0} bytes", totalDiskSize);
|
||||
return DiskType.Unknown;
|
||||
}
|
||||
}
|
||||
@@ -1012,8 +978,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
return DiskType.SHARP_35;
|
||||
default:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 3,5\" disk with {0} bytes", totalDiskSize);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Unknown 3,5\" disk with {0} bytes", totalDiskSize);
|
||||
return DiskType.Unknown;
|
||||
}
|
||||
}
|
||||
@@ -1061,16 +1026,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
return DiskType.ECMA_69_26;
|
||||
default:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 8\" disk with {0} bytes", totalDiskSize);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Unknown 8\" disk with {0} bytes", totalDiskSize);
|
||||
return DiskType.Unknown;
|
||||
}
|
||||
}
|
||||
}
|
||||
default:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Unknown drive type {1} with {0} bytes", totalDiskSize, header.driveType);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Unknown drive type {1} with {0} bytes", totalDiskSize, header.driveType);
|
||||
return DiskType.Unknown;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
@@ -459,11 +460,8 @@ namespace DiscImageChef.ImagePlugins
|
||||
UInt32 headerCalculatedChecksum = VHDChecksum(header);
|
||||
UInt32 footerCalculatedChecksum = VHDChecksum(footer);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): Header checksum = 0x{0:X8}, calculated = 0x{1:X8}", headerChecksum, headerCalculatedChecksum);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): Header checksum = 0x{0:X8}, calculated = 0x{1:X8}", footerChecksum, footerCalculatedChecksum);
|
||||
}
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Header checksum = 0x{0:X8}, calculated = 0x{1:X8}", headerChecksum, headerCalculatedChecksum);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Header checksum = 0x{0:X8}, calculated = 0x{1:X8}", footerChecksum, footerCalculatedChecksum);
|
||||
|
||||
byte[] usableHeader;
|
||||
UInt32 usableChecksum;
|
||||
@@ -503,32 +501,29 @@ namespace DiscImageChef.ImagePlugins
|
||||
thisDateTime = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
thisDateTime = thisDateTime.AddSeconds(thisFooter.timestamp);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Checksums.SHA1Context sha1Ctx = new Checksums.SHA1Context();
|
||||
sha1Ctx.Init();
|
||||
sha1Ctx.Update(thisFooter.reserved);
|
||||
Checksums.SHA1Context sha1Ctx = new Checksums.SHA1Context();
|
||||
sha1Ctx.Init();
|
||||
sha1Ctx.Update(thisFooter.reserved);
|
||||
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.cookie = 0x{0:X8}", thisFooter.cookie);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.features = 0x{0:X8}", thisFooter.features);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.version = 0x{0:X8}", thisFooter.version);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.offset = {0}", thisFooter.offset);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.timestamp = 0x{0:X8} ({1})", thisFooter.timestamp, thisDateTime);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.creatorApplication = 0x{0:X8} (\"{1}\")", thisFooter.creatorApplication,
|
||||
Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(thisFooter.creatorApplication)));
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.creatorVersion = 0x{0:X8}", thisFooter.creatorVersion);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.creatorHostOS = 0x{0:X8} (\"{1}\")", thisFooter.creatorHostOS,
|
||||
Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(thisFooter.creatorHostOS)));
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.originalSize = {0}", thisFooter.originalSize);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.currentSize = {0}", thisFooter.currentSize);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.diskGeometry = 0x{0:X8} (C/H/S: {1}/{2}/{3})", thisFooter.diskGeometry,
|
||||
(thisFooter.diskGeometry & 0xFFFF0000) >> 16, (thisFooter.diskGeometry & 0xFF00) >> 8, (thisFooter.diskGeometry & 0xFF));
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.diskType = 0x{0:X8}", thisFooter.diskType);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.checksum = 0x{0:X8}", thisFooter.checksum);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.uniqueId = {0}", thisFooter.uniqueId);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.savedState = 0x{0:X2}", thisFooter.savedState);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.reserved's SHA1 = 0x{0}", sha1Ctx.End());
|
||||
}
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.cookie = 0x{0:X8}", thisFooter.cookie);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.features = 0x{0:X8}", thisFooter.features);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.version = 0x{0:X8}", thisFooter.version);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.offset = {0}", thisFooter.offset);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.timestamp = 0x{0:X8} ({1})", thisFooter.timestamp, thisDateTime);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.creatorApplication = 0x{0:X8} (\"{1}\")", thisFooter.creatorApplication,
|
||||
Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(thisFooter.creatorApplication)));
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.creatorVersion = 0x{0:X8}", thisFooter.creatorVersion);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.creatorHostOS = 0x{0:X8} (\"{1}\")", thisFooter.creatorHostOS,
|
||||
Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(thisFooter.creatorHostOS)));
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.originalSize = {0}", thisFooter.originalSize);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.currentSize = {0}", thisFooter.currentSize);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.diskGeometry = 0x{0:X8} (C/H/S: {1}/{2}/{3})", thisFooter.diskGeometry,
|
||||
(thisFooter.diskGeometry & 0xFFFF0000) >> 16, (thisFooter.diskGeometry & 0xFF00) >> 8, (thisFooter.diskGeometry & 0xFF));
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.diskType = 0x{0:X8}", thisFooter.diskType);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.checksum = 0x{0:X8}", thisFooter.checksum);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.uniqueId = {0}", thisFooter.uniqueId);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.savedState = 0x{0:X2}", thisFooter.savedState);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.reserved's SHA1 = 0x{0}", sha1Ctx.End());
|
||||
|
||||
if (thisFooter.version == Version1)
|
||||
ImageInfo.imageVersion = "1.0";
|
||||
@@ -655,8 +650,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
UInt32 dynamicChecksumCalculated = VHDChecksum(dynamicBytes);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): Dynamic header checksum = 0x{0:X8}, calculated = 0x{1:X8}", dynamicChecksum, dynamicChecksumCalculated);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Dynamic header checksum = 0x{0:X8}, calculated = 0x{1:X8}", dynamicChecksum, dynamicChecksumCalculated);
|
||||
|
||||
if (dynamicChecksum != dynamicChecksumCalculated)
|
||||
throw new ImageNotSupportedException("(VirtualPC plugin): Both header and footer are corrupt, image cannot be opened.");
|
||||
@@ -694,34 +688,31 @@ namespace DiscImageChef.ImagePlugins
|
||||
parentDateTime = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
parentDateTime = parentDateTime.AddSeconds(thisDynamic.parentTimestamp);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Checksums.SHA1Context sha1Ctx = new Checksums.SHA1Context();
|
||||
sha1Ctx.Init();
|
||||
sha1Ctx.Update(thisDynamic.reserved2);
|
||||
sha1Ctx = new Checksums.SHA1Context();
|
||||
sha1Ctx.Init();
|
||||
sha1Ctx.Update(thisDynamic.reserved2);
|
||||
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.cookie = 0x{0:X8}", thisDynamic.cookie);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.dataOffset = {0}", thisDynamic.dataOffset);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.tableOffset = {0}", thisDynamic.tableOffset);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.headerVersion = 0x{0:X8}", thisDynamic.headerVersion);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.maxTableEntries = {0}", thisDynamic.maxTableEntries);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.blockSize = {0}", thisDynamic.blockSize);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.checksum = 0x{0:X8}", thisDynamic.checksum);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.parentID = {0}", thisDynamic.parentID);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.parentTimestamp = 0x{0:X8} ({1})", thisDynamic.parentTimestamp, parentDateTime);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.reserved = 0x{0:X8}", thisDynamic.reserved);
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}].platformCode = 0x{1:X8} (\"{2}\")", i, thisDynamic.locatorEntries[i].platformCode,
|
||||
Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(thisDynamic.locatorEntries[i].platformCode)));
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}].platformDataSpace = {1}", i, thisDynamic.locatorEntries[i].platformDataSpace);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}].platformDataLength = {1}", i, thisDynamic.locatorEntries[i].platformDataLength);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}].reserved = 0x{1:X8}", i, thisDynamic.locatorEntries[i].reserved);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}].platformDataOffset = {1}", i, thisDynamic.locatorEntries[i].platformDataOffset);
|
||||
}
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.parentName = \"{0}\"", thisDynamic.parentName);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.reserved2's SHA1 = 0x{0}", sha1Ctx.End());
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.cookie = 0x{0:X8}", thisDynamic.cookie);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.dataOffset = {0}", thisDynamic.dataOffset);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.tableOffset = {0}", thisDynamic.tableOffset);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.headerVersion = 0x{0:X8}", thisDynamic.headerVersion);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.maxTableEntries = {0}", thisDynamic.maxTableEntries);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.blockSize = {0}", thisDynamic.blockSize);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.checksum = 0x{0:X8}", thisDynamic.checksum);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.parentID = {0}", thisDynamic.parentID);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.parentTimestamp = 0x{0:X8} ({1})", thisDynamic.parentTimestamp, parentDateTime);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.reserved = 0x{0:X8}", thisDynamic.reserved);
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}].platformCode = 0x{1:X8} (\"{2}\")", i, thisDynamic.locatorEntries[i].platformCode,
|
||||
Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(thisDynamic.locatorEntries[i].platformCode)));
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}].platformDataSpace = {1}", i, thisDynamic.locatorEntries[i].platformDataSpace);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}].platformDataLength = {1}", i, thisDynamic.locatorEntries[i].platformDataLength);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}].reserved = 0x{1:X8}", i, thisDynamic.locatorEntries[i].reserved);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}].platformDataOffset = {1}", i, thisDynamic.locatorEntries[i].platformDataOffset);
|
||||
}
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.parentName = \"{0}\"", thisDynamic.parentName);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.reserved2's SHA1 = 0x{0}", sha1Ctx.End());
|
||||
|
||||
if (thisDynamic.headerVersion != Version1)
|
||||
throw new ImageNotSupportedException(String.Format("(VirtualPC plugin): Unknown image type {0} found. Please submit a bug with an example image.", thisFooter.diskType));
|
||||
@@ -738,11 +729,8 @@ namespace DiscImageChef.ImagePlugins
|
||||
for (int i = 0; i < thisDynamic.maxTableEntries; i++)
|
||||
blockAllocationTable[i] = BigEndianBitConverter.ToUInt32(bat, 4 * i);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
DateTime endTime = DateTime.UtcNow;
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): Filling the BAT took {0} seconds", (endTime-startTime).TotalSeconds);
|
||||
}
|
||||
DateTime endTime = DateTime.UtcNow;
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Filling the BAT took {0} seconds", (endTime-startTime).TotalSeconds);
|
||||
*/
|
||||
|
||||
// How many sectors uses the BAT
|
||||
@@ -769,19 +757,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
Array.Copy(batSector.blockPointer, 0, blockAllocationTable, (i * 512) / 4, blockAllocationTable.Length - (i * 512) / 4);
|
||||
}
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
DateTime endTime = DateTime.UtcNow;
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): Filling the BAT took {0} seconds", (endTime - startTime).TotalSeconds);
|
||||
}
|
||||
DateTime endTime = DateTime.UtcNow;
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Filling the BAT took {0} seconds", (endTime - startTime).TotalSeconds);
|
||||
|
||||
// Too noisy
|
||||
/*
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
for (int i = 0; i < thisDynamic.maxTableEntries; i++)
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): blockAllocationTable[{0}] = {1}", i, blockAllocationTable[i]);
|
||||
}*/
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "blockAllocationTable[{0}] = {1}", i, blockAllocationTable[i]);
|
||||
*/
|
||||
|
||||
// Get the roundest number of sectors needed to store the block bitmap
|
||||
bitmapSize = (uint)Math.Ceiling((
|
||||
@@ -791,8 +774,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
/ 8
|
||||
// and aligned to 512 byte boundary
|
||||
/ 512));
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): Bitmap is {0} sectors", bitmapSize);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Bitmap is {0} sectors", bitmapSize);
|
||||
}
|
||||
|
||||
switch (thisFooter.diskType)
|
||||
@@ -815,26 +797,23 @@ namespace DiscImageChef.ImagePlugins
|
||||
imageStream.Seek((long)thisDynamic.locatorEntries[i].platformDataOffset, SeekOrigin.Begin);
|
||||
imageStream.Read(locatorEntriesData[i], 0, (int)thisDynamic.locatorEntries[i].platformDataLength);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
switch (thisDynamic.locatorEntries[i].platformCode)
|
||||
{
|
||||
switch (thisDynamic.locatorEntries[i].platformCode)
|
||||
{
|
||||
case platformCodeWindowsAbsolute:
|
||||
case platformCodeWindowsRelative:
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}] = \"{1}\"", i, Encoding.ASCII.GetString(locatorEntriesData[i]));
|
||||
break;
|
||||
case platformCodeWindowsAbsoluteU:
|
||||
case platformCodeWindowsRelativeU:
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}] = \"{1}\"", i, Encoding.BigEndianUnicode.GetString(locatorEntriesData[i]));
|
||||
break;
|
||||
case platformCodeMacintoshURI:
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}] = \"{1}\"", i, Encoding.UTF8.GetString(locatorEntriesData[i]));
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}] =", i);
|
||||
PrintHex.PrintHexArray(locatorEntriesData[i], 64);
|
||||
break;
|
||||
}
|
||||
case platformCodeWindowsAbsolute:
|
||||
case platformCodeWindowsRelative:
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}] = \"{1}\"", i, Encoding.ASCII.GetString(locatorEntriesData[i]));
|
||||
break;
|
||||
case platformCodeWindowsAbsoluteU:
|
||||
case platformCodeWindowsRelativeU:
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}] = \"{1}\"", i, Encoding.BigEndianUnicode.GetString(locatorEntriesData[i]));
|
||||
break;
|
||||
case platformCodeMacintoshURI:
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}] = \"{1}\"", i, Encoding.UTF8.GetString(locatorEntriesData[i]));
|
||||
break;
|
||||
default:
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}] =", i);
|
||||
PrintHex.PrintHexArray(locatorEntriesData[i], 64);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -861,8 +840,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
parentPath = parentPath.Remove(0, 16);
|
||||
else
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin) Unsupported protocol classified found in URI parent path: \"{0}\"", parentPath);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Unsupported protocol classified found in URI parent path: \"{0}\"", parentPath);
|
||||
parentPath = null;
|
||||
}
|
||||
break;
|
||||
@@ -870,8 +848,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
if (parentPath != null)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin) Possible parent path: \"{0}\"", parentPath);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Possible parent path: \"{0}\"", parentPath);
|
||||
|
||||
locatorFound |= File.Exists(parentPath);
|
||||
|
||||
@@ -1026,27 +1003,23 @@ namespace DiscImageChef.ImagePlugins
|
||||
bool dirty = false || (bitmap[bitmapByte] & mask) == mask;
|
||||
|
||||
/*
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): bitmapSize = {0}", bitmapSize);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): blockNumber = {0}", blockNumber);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): sectorInBlock = {0}", sectorInBlock);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): blockOffset = {0}", blockOffset);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): bitmapByte = {0}", bitmapByte);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): bitmapBit = {0}", bitmapBit);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): mask = 0x{0:X2}", mask);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dirty = 0x{0}", dirty);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): bitmap = ");
|
||||
PrintHex.PrintHexArray(bitmap, 64);
|
||||
}
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "bitmapSize = {0}", bitmapSize);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "blockNumber = {0}", blockNumber);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "sectorInBlock = {0}", sectorInBlock);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "blockOffset = {0}", blockOffset);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "bitmapByte = {0}", bitmapByte);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "bitmapBit = {0}", bitmapBit);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "mask = 0x{0:X2}", mask);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dirty = 0x{0}", dirty);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "bitmap = ");
|
||||
PrintHex.PrintHexArray(bitmap, 64);
|
||||
*/
|
||||
|
||||
// Sector has been written, read from child image
|
||||
if (dirty)
|
||||
{
|
||||
/* Too noisy
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): Sector {0} is dirty", sectorAddress);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Sector {0} is dirty", sectorAddress);
|
||||
*/
|
||||
|
||||
byte[] data = new byte[512];
|
||||
@@ -1062,8 +1035,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
|
||||
/* Too noisy
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): Sector {0} is clean", sectorAddress);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Sector {0} is clean", sectorAddress);
|
||||
*/
|
||||
|
||||
// Read sector from parent image
|
||||
|
||||
Reference in New Issue
Block a user