* docs/floppies.ods:

Added table with known floppy formats and their geometries.

	* FileSystemIDandChk/Plugins/FAT.cs:
	* FileSystemIDandChk/DateHandlers.cs:
	  Prettify debug output.
This commit is contained in:
2014-06-07 23:38:42 +01:00
parent 0024671731
commit e8cdd9bb5f
3 changed files with 13 additions and 13 deletions

View File

@@ -79,7 +79,7 @@ namespace FileSystemIDandChk
fourcharvalue[2] = VDDateTime[2];
fourcharvalue[3] = VDDateTime[3];
if (MainClass.isDebug)
Console.WriteLine("ISO9600ToDateTime: year = \"{0}\"", StringHandlers.CToString(fourcharvalue));
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): year = \"{0}\"", StringHandlers.CToString(fourcharvalue));
if (!Int32.TryParse(StringHandlers.CToString(fourcharvalue), out year))
year = 0;
// year = Convert.ToInt32(StringHandlers.CToString(fourcharvalue));
@@ -87,7 +87,7 @@ namespace FileSystemIDandChk
twocharvalue[0] = VDDateTime[4];
twocharvalue[1] = VDDateTime[5];
if (MainClass.isDebug)
Console.WriteLine("ISO9600ToDateTime: month = \"{0}\"", StringHandlers.CToString(twocharvalue));
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): month = \"{0}\"", StringHandlers.CToString(twocharvalue));
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out month))
month = 0;
// month = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
@@ -95,7 +95,7 @@ namespace FileSystemIDandChk
twocharvalue[0] = VDDateTime[6];
twocharvalue[1] = VDDateTime[7];
if (MainClass.isDebug)
Console.WriteLine("ISO9600ToDateTime: day = \"{0}\"", StringHandlers.CToString(twocharvalue));
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): day = \"{0}\"", StringHandlers.CToString(twocharvalue));
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out day))
day = 0;
// day = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
@@ -103,7 +103,7 @@ namespace FileSystemIDandChk
twocharvalue[0] = VDDateTime[8];
twocharvalue[1] = VDDateTime[9];
if (MainClass.isDebug)
Console.WriteLine("ISO9600ToDateTime: hour = \"{0}\"", StringHandlers.CToString(twocharvalue));
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): hour = \"{0}\"", StringHandlers.CToString(twocharvalue));
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out hour))
hour = 0;
// hour = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
@@ -111,7 +111,7 @@ namespace FileSystemIDandChk
twocharvalue[0] = VDDateTime[10];
twocharvalue[1] = VDDateTime[11];
if (MainClass.isDebug)
Console.WriteLine("ISO9600ToDateTime: minute = \"{0}\"", StringHandlers.CToString(twocharvalue));
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): minute = \"{0}\"", StringHandlers.CToString(twocharvalue));
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out minute))
minute = 0;
// minute = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
@@ -119,7 +119,7 @@ namespace FileSystemIDandChk
twocharvalue[0] = VDDateTime[12];
twocharvalue[1] = VDDateTime[13];
if (MainClass.isDebug)
Console.WriteLine("ISO9600ToDateTime: second = \"{0}\"", StringHandlers.CToString(twocharvalue));
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): second = \"{0}\"", StringHandlers.CToString(twocharvalue));
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out second))
second = 0;
// second = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
@@ -127,13 +127,13 @@ namespace FileSystemIDandChk
twocharvalue[0] = VDDateTime[14];
twocharvalue[1] = VDDateTime[15];
if (MainClass.isDebug)
Console.WriteLine("ISO9600ToDateTime: hundredths = \"{0}\"", StringHandlers.CToString(twocharvalue));
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): hundredths = \"{0}\"", StringHandlers.CToString(twocharvalue));
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out hundredths))
hundredths = 0;
// hundredths = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
if (MainClass.isDebug)
Console.WriteLine("ISO9600ToDateTime: decodedDT = new DateTime({0}, {1}, {2}, {3}, {4}, {5}, {6}, DateTimeKind.Unspecified);", year, month, day, hour, minute, second, hundredths * 10);
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): decodedDT = new DateTime({0}, {1}, {2}, {3}, {4}, {5}, {6}, DateTimeKind.Unspecified);", year, month, day, hour, minute, second, hundredths * 10);
DateTime decodedDT = new DateTime(year, month, day, hour, minute, second, hundredths * 10, DateTimeKind.Unspecified);
return decodedDT;

View File

@@ -85,11 +85,11 @@ namespace FileSystemIDandChk.Plugins
if (MainClass.isDebug)
{
Console.WriteLine("FAT: fats_no = {0}", fats_no);
Console.WriteLine("FAT: media_descriptor = 0x{0:X2}", media_descriptor);
Console.WriteLine("FAT: fat32_signature = {0}", StringHandlers.CToString(fat32_signature));
Console.WriteLine("FAT: bps = {0}", bps);
Console.WriteLine("FAT: first_fat_entry = 0x{0:X8}", first_fat_entry);
Console.WriteLine("DEBUG (FAT plugin): fats_no = {0}", fats_no);
Console.WriteLine("DEBUG (FAT plugin): media_descriptor = 0x{0:X2}", media_descriptor);
Console.WriteLine("DEBUG (FAT plugin): fat32_signature = {0}", StringHandlers.CToString(fat32_signature));
Console.WriteLine("DEBUG (FAT plugin): bps = {0}", bps);
Console.WriteLine("DEBUG (FAT plugin): first_fat_entry = 0x{0:X8}", first_fat_entry);
}
if (fats_no > 2) // Must be 1 or 2, but as TOS makes strange things and I have not checked if it puts this to 0, ignore if 0. MUST NOT BE BIGGER THAN 2!

BIN
docs/floppies.ods Normal file

Binary file not shown.