mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Reformat code.
This commit is contained in:
@@ -41,15 +41,20 @@ namespace DiscImageChef.PartPlugins
|
||||
{
|
||||
public class Apricot : PartPlugin
|
||||
{
|
||||
readonly string[] operatingSystemCodes = { "Invalid", "MS-DOS", "UCSD Pascal", "CP/M", "Concurrent CP/M" };
|
||||
readonly string[] bootTypeCodes = { "Non-bootable", "Apricot & XI RAM BIOS", "Generic ROM BIOS", "Apricot & XI ROM BIOS", "Apricot Portable ROM BIOS", "Apricot F1 ROM BIOS" };
|
||||
readonly string[] diskTypeCodes = { "MF1DD 70-track", "MF1DD", "MF2DD", "Winchester 5M", "Winchester 10M", "Winchester 20M" };
|
||||
readonly string[] printDevices = { "Parallel", "Serial" };
|
||||
readonly int[] lineModes = { 256, 200 };
|
||||
readonly int[] lineWidths = { 80, 40 };
|
||||
readonly int[] baudRates = { 50, 75, 110, 134, 150, 300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 19200 };
|
||||
readonly double[] stopBits = { 1, 1.5, 2 };
|
||||
readonly string[] parityTypes = { "None", "Odd", "Even", "Mark", "Space" };
|
||||
readonly string[] operatingSystemCodes = {"Invalid", "MS-DOS", "UCSD Pascal", "CP/M", "Concurrent CP/M"};
|
||||
readonly string[] bootTypeCodes =
|
||||
{
|
||||
"Non-bootable", "Apricot & XI RAM BIOS", "Generic ROM BIOS", "Apricot & XI ROM BIOS",
|
||||
"Apricot Portable ROM BIOS", "Apricot F1 ROM BIOS"
|
||||
};
|
||||
readonly string[] diskTypeCodes =
|
||||
{"MF1DD 70-track", "MF1DD", "MF2DD", "Winchester 5M", "Winchester 10M", "Winchester 20M"};
|
||||
readonly string[] printDevices = {"Parallel", "Serial"};
|
||||
readonly int[] lineModes = {256, 200};
|
||||
readonly int[] lineWidths = {80, 40};
|
||||
readonly int[] baudRates = {50, 75, 110, 134, 150, 300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 19200};
|
||||
readonly double[] stopBits = {1, 1.5, 2};
|
||||
readonly string[] parityTypes = {"None", "Odd", "Even", "Mark", "Space"};
|
||||
|
||||
public Apricot()
|
||||
{
|
||||
@@ -62,13 +67,11 @@ namespace DiscImageChef.PartPlugins
|
||||
partitions = new List<Partition>();
|
||||
|
||||
// I think Apricot can't chain partitions so.
|
||||
if(sectorOffset != 0)
|
||||
return false;
|
||||
if(sectorOffset != 0) return false;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(0);
|
||||
|
||||
if(sector.Length < 512)
|
||||
return false;
|
||||
if(sector.Length < 512) return false;
|
||||
|
||||
ApricotLabel label = new ApricotLabel();
|
||||
IntPtr lblPtr = Marshal.AllocHGlobal(512);
|
||||
@@ -79,14 +82,21 @@ namespace DiscImageChef.PartPlugins
|
||||
// Not much to check but...
|
||||
ulong deviceSectors = imagePlugin.GetSectors();
|
||||
ulong deviceSizeAccordingToLabel = label.cylinders * label.heads * label.spt;
|
||||
if(label.operatingSystem > 4 || label.bootType > 5 || label.partitionCount > 8 || deviceSizeAccordingToLabel > deviceSectors || label.firstDataBlock > deviceSectors)
|
||||
return false;
|
||||
if(label.operatingSystem > 4 || label.bootType > 5 || label.partitionCount > 8 ||
|
||||
deviceSizeAccordingToLabel > deviceSectors || label.firstDataBlock > deviceSectors) return false;
|
||||
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.version = \"{0}\"", StringHandlers.CToString(label.version));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.operatingSystem = {0} ({1})", label.operatingSystem, label.operatingSystem < operatingSystemCodes.Length ? operatingSystemCodes[label.operatingSystem] : "Unknown");
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.version = \"{0}\"",
|
||||
StringHandlers.CToString(label.version));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.operatingSystem = {0} ({1})", label.operatingSystem,
|
||||
label.operatingSystem < operatingSystemCodes.Length
|
||||
? operatingSystemCodes[label.operatingSystem]
|
||||
: "Unknown");
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.writeProtected = {0}", label.writeProtected);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.copyProtected = {0}", label.copyProtected);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.bootType = {0} ({1})", label.bootType, label.bootType < bootTypeCodes.Length ? bootTypeCodes[label.bootType] : "Unknown");
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.bootType = {0} ({1})", label.bootType,
|
||||
label.bootType < bootTypeCodes.Length
|
||||
? bootTypeCodes[label.bootType]
|
||||
: "Unknown");
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitionCount = {0}", label.partitionCount);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.winchester = {0}", label.winchester);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.sectorSize = {0}", label.sectorSize);
|
||||
@@ -98,14 +108,18 @@ namespace DiscImageChef.PartPlugins
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.bootLocation = {0}", label.bootLocation);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.bootSize = {0}", label.bootSize);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.bootAddress = 0x{0:X8}", label.bootAddress);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.bootOffset:label.bootSegment = {0:X4}:{1:X4}", label.bootOffset, label.bootSegment);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.bootOffset:label.bootSegment = {0:X4}:{1:X4}",
|
||||
label.bootOffset, label.bootSegment);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.firstDataBlock = {0}", label.firstDataBlock);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.generation = {0}", label.generation);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.copyCount = {0}", label.copyCount);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.maxCopies = {0}", label.maxCopies);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.serialNumber = \"{0}\"", StringHandlers.CToString(label.serialNumber));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partNumber = \"{0}\"", StringHandlers.CToString(label.partNumber));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.copyright = \"{0}\"", StringHandlers.CToString(label.copyright));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.serialNumber = \"{0}\"",
|
||||
StringHandlers.CToString(label.serialNumber));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partNumber = \"{0}\"",
|
||||
StringHandlers.CToString(label.partNumber));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.copyright = \"{0}\"",
|
||||
StringHandlers.CToString(label.copyright));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.mainBPB.bps = {0}", label.mainBPB.bps);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.mainBPB.spc = {0}", label.mainBPB.spc);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.mainBPB.rsectors = {0}", label.mainBPB.rsectors);
|
||||
@@ -114,14 +128,24 @@ namespace DiscImageChef.PartPlugins
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.mainBPB.sectors = {0}", label.mainBPB.sectors);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.mainBPB.media = {0}", label.mainBPB.media);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.mainBPB.spfat = {0}", label.mainBPB.spfat);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.mainBPB.diskType = {0} ({1})", label.mainBPB.diskType, label.mainBPB.diskType < diskTypeCodes.Length ? diskTypeCodes[label.mainBPB.diskType] : "Unknown");
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.mainBPB.startSector = {0}", label.mainBPB.startSector);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.fontName = \"{0}\"", StringHandlers.CToString(label.fontName));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.keyboardName = \"{0}\"", StringHandlers.CToString(label.keyboardName));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.mainBPB.diskType = {0} ({1})",
|
||||
label.mainBPB.diskType,
|
||||
label.mainBPB.diskType < diskTypeCodes.Length
|
||||
? diskTypeCodes[label.mainBPB.diskType]
|
||||
: "Unknown");
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.mainBPB.startSector = {0}",
|
||||
label.mainBPB.startSector);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.fontName = \"{0}\"",
|
||||
StringHandlers.CToString(label.fontName));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.keyboardName = \"{0}\"",
|
||||
StringHandlers.CToString(label.keyboardName));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.biosMajorVersion = {0}", label.biosMajorVersion);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.biosMinorVersion = {0}", label.biosMinorVersion);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.diagnosticsFlag = {0}", label.diagnosticsFlag);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.prnDevice = {0} ({1})", label.prnDevice, label.prnDevice < printDevices.Length ? printDevices[label.prnDevice] : "Unknown");
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.prnDevice = {0} ({1})", label.prnDevice,
|
||||
label.prnDevice < printDevices.Length
|
||||
? printDevices[label.prnDevice]
|
||||
: "Unknown");
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.bellVolume = {0}", label.bellVolume);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.enableCache = {0}", label.enableCache);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.enableGraphics = {0}", label.enableGraphics);
|
||||
@@ -136,18 +160,28 @@ namespace DiscImageChef.PartPlugins
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.autorepeatLeadIn = {0}", label.autorepeatLeadIn);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.autorepeatInterval = {0}", label.autorepeatInterval);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.microscreenMode = {0}", label.microscreenMode);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.spareKeyboard is null? = {0}", ArrayHelpers.ArrayIsNullOrEmpty(label.spareKeyboard));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.lineMode = {0} ({1} lines)", label.lineMode, label.lineMode < lineModes.Length ? lineModes[label.lineMode] : 0);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.lineWidth = {0} ({1} columns)", label.lineWidth, label.lineWidth < lineWidths.Length ? lineWidths[label.lineWidth] : 0);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.spareKeyboard is null? = {0}",
|
||||
ArrayHelpers.ArrayIsNullOrEmpty(label.spareKeyboard));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.lineMode = {0} ({1} lines)", label.lineMode,
|
||||
label.lineMode < lineModes.Length ? lineModes[label.lineMode] : 0);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.lineWidth = {0} ({1} columns)", label.lineWidth,
|
||||
label.lineWidth < lineWidths.Length ? lineWidths[label.lineWidth] : 0);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.imageOff = {0}", label.imageOff);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.spareScreen is null? = {0}", ArrayHelpers.ArrayIsNullOrEmpty(label.spareScreen));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.txBaudRate = {0} ({1} bps)", label.txBaudRate, label.txBaudRate < baudRates.Length ? baudRates[label.txBaudRate] : 0);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.rxBaudRate = {0} ({1} bps)", label.rxBaudRate, label.rxBaudRate < baudRates.Length ? baudRates[label.rxBaudRate] : 0);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.spareScreen is null? = {0}",
|
||||
ArrayHelpers.ArrayIsNullOrEmpty(label.spareScreen));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.txBaudRate = {0} ({1} bps)", label.txBaudRate,
|
||||
label.txBaudRate < baudRates.Length ? baudRates[label.txBaudRate] : 0);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.rxBaudRate = {0} ({1} bps)", label.rxBaudRate,
|
||||
label.rxBaudRate < baudRates.Length ? baudRates[label.rxBaudRate] : 0);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.txBits = {0}", label.txBits);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.rxBits = {0}", label.rxBits);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.stopBits = {0} ({1} bits)", label.stopBits, label.stopBits < stopBits.Length ? stopBits[label.stopBits] : 0);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.stopBits = {0} ({1} bits)", label.stopBits,
|
||||
label.stopBits < stopBits.Length ? stopBits[label.stopBits] : 0);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.parityCheck = {0}", label.parityCheck);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.parityType = {0} ({1})", label.parityType, label.parityType < parityTypes.Length ? parityTypes[label.parityType] : "Unknown");
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.parityType = {0} ({1})", label.parityType,
|
||||
label.parityType < parityTypes.Length
|
||||
? parityTypes[label.parityType]
|
||||
: "Unknown");
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.txXonXoff = {0}", label.txXonXoff);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.rxXonXoff = {0}", label.rxXonXoff);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.xonCharacter = {0}", label.xonCharacter);
|
||||
@@ -158,39 +192,59 @@ namespace DiscImageChef.PartPlugins
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.nullsAfterCr = {0}", label.nullsAfterCr);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.nullsAfterFF = {0}", label.nullsAfterFF);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.lfAfterCRSerial = {0}", label.lfAfterCRSerial);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.biosErrorReportSerial = {0}", label.biosErrorReportSerial);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.spareSerial is null? = {0}", ArrayHelpers.ArrayIsNullOrEmpty(label.spareSerial));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.biosErrorReportSerial = {0}",
|
||||
label.biosErrorReportSerial);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.spareSerial is null? = {0}",
|
||||
ArrayHelpers.ArrayIsNullOrEmpty(label.spareSerial));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.lfAfterCrParallel = {0}", label.lfAfterCrParallel);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.selectLine = {0}", label.selectLine);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.paperEmpty = {0}", label.paperEmpty);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.faultLine = {0}", label.faultLine);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.biosErrorReportParallel = {0}", label.biosErrorReportParallel);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.spareParallel is null? = {0}", ArrayHelpers.ArrayIsNullOrEmpty(label.spareParallel));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.spareWinchester is null? = {0}", ArrayHelpers.ArrayIsNullOrEmpty(label.spareWinchester));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.biosErrorReportParallel = {0}",
|
||||
label.biosErrorReportParallel);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.spareParallel is null? = {0}",
|
||||
ArrayHelpers.ArrayIsNullOrEmpty(label.spareParallel));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.spareWinchester is null? = {0}",
|
||||
ArrayHelpers.ArrayIsNullOrEmpty(label.spareWinchester));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.parkingEnabled = {0}", label.parkingEnabled);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.formatProtection = {0}", label.formatProtection);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.spareRamDisk is null? = {0}", ArrayHelpers.ArrayIsNullOrEmpty(label.spareRamDisk));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.spareRamDisk is null? = {0}",
|
||||
ArrayHelpers.ArrayIsNullOrEmpty(label.spareRamDisk));
|
||||
for(int i = 0; i < 32; i++)
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.badBlocks[{1}] = {0}", label.badBlocks[i], i);
|
||||
for(int i = 0; i < 8; i++)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].bps = {0}", label.partitions[i].bps, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].spc = {0}", label.partitions[i].spc, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].rsectors = {0}", label.partitions[i].rsectors, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].fats_no = {0}", label.partitions[i].fats_no, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].root_ent = {0}", label.partitions[i].root_ent, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].sectors = {0}", label.partitions[i].sectors, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].media = {0}", label.partitions[i].media, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].spfat = {0}", label.partitions[i].spfat, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].diskType = {0} ({2})", label.partitions[i].diskType, i, label.partitions[i].diskType < diskTypeCodes.Length ? diskTypeCodes[label.partitions[i].diskType] : "Unknown");
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].startSector = {0}", label.partitions[i].startSector, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].bps = {0}",
|
||||
label.partitions[i].bps, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].spc = {0}",
|
||||
label.partitions[i].spc, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].rsectors = {0}",
|
||||
label.partitions[i].rsectors, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].fats_no = {0}",
|
||||
label.partitions[i].fats_no, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].root_ent = {0}",
|
||||
label.partitions[i].root_ent, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].sectors = {0}",
|
||||
label.partitions[i].sectors, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].media = {0}",
|
||||
label.partitions[i].media, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].spfat = {0}",
|
||||
label.partitions[i].spfat, i);
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].diskType = {0} ({2})",
|
||||
label.partitions[i].diskType, i,
|
||||
label.partitions[i].diskType < diskTypeCodes.Length
|
||||
? diskTypeCodes[label.partitions[i].diskType]
|
||||
: "Unknown");
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.partitions[{1}].startSector = {0}",
|
||||
label.partitions[i].startSector, i);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.spare is null? = {0}", ArrayHelpers.ArrayIsNullOrEmpty(label.spare));
|
||||
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.spare is null? = {0}",
|
||||
ArrayHelpers.ArrayIsNullOrEmpty(label.spare));
|
||||
DicConsole.DebugWriteLine("Apricot partitions", "label.cpmDoubleSided = {0}", label.cpmDoubleSided);
|
||||
|
||||
// Only hard disks can contain partitions
|
||||
if(!label.winchester)
|
||||
return false;
|
||||
if(!label.winchester) return false;
|
||||
|
||||
for(byte i = 0; i < label.partitionCount; i++)
|
||||
{
|
||||
@@ -204,8 +258,7 @@ namespace DiscImageChef.PartPlugins
|
||||
Scheme = Name,
|
||||
Offset = (ulong)(label.partitions[i].startSector * label.sectorSize)
|
||||
};
|
||||
if(part.Start < deviceSectors && part.End < deviceSectors)
|
||||
partitions.Add(part);
|
||||
if(part.Start < deviceSectors && part.End < deviceSectors) partitions.Add(part);
|
||||
}
|
||||
|
||||
return partitions.Count > 0;
|
||||
@@ -216,23 +269,19 @@ namespace DiscImageChef.PartPlugins
|
||||
public struct ApricotLabel
|
||||
{
|
||||
/// <summary>Version of format which created disk</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
|
||||
public byte[] version;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] version;
|
||||
/// <summary>Operating system.</summary>
|
||||
public byte operatingSystem;
|
||||
/// <summary>Software write protection.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool writeProtected;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool writeProtected;
|
||||
/// <summary>Copy protected.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool copyProtected;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool copyProtected;
|
||||
/// <summary>Boot type.</summary>
|
||||
public byte bootType;
|
||||
/// <summary>Partitions.</summary>
|
||||
public byte partitionCount;
|
||||
/// <summary>Is hard disk?.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool winchester;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool winchester;
|
||||
/// <summary>Sector size.</summary>
|
||||
public ushort sectorSize;
|
||||
/// <summary>Sectors per track.</summary>
|
||||
@@ -264,39 +313,31 @@ namespace DiscImageChef.PartPlugins
|
||||
/// <summary>Maximum number of copies.</summary>
|
||||
public ushort maxCopies;
|
||||
/// <summary>Serial number.</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
|
||||
public byte[] serialNumber;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] serialNumber;
|
||||
/// <summary>Part number.</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
|
||||
public byte[] partNumber;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] partNumber;
|
||||
/// <summary>Copyright.</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)]
|
||||
public byte[] copyright;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)] public byte[] copyright;
|
||||
/// <summary>BPB for whole disk.</summary>
|
||||
public ApricotParameterBlock mainBPB;
|
||||
/// <summary>Name of FONT file.</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
||||
public byte[] fontName;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] fontName;
|
||||
/// <summary>Name of KEYBOARD file.</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
||||
public byte[] keyboardName;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] keyboardName;
|
||||
/// <summary>Minor BIOS version.</summary>
|
||||
public byte biosMinorVersion;
|
||||
/// <summary>Major BIOS version.</summary>
|
||||
public byte biosMajorVersion;
|
||||
/// <summary>Diagnostics enabled?.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool diagnosticsFlag;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool diagnosticsFlag;
|
||||
/// <summary>Printer device.</summary>
|
||||
public byte prnDevice;
|
||||
/// <summary>Bell volume.</summary>
|
||||
public byte bellVolume;
|
||||
/// <summary>Cache enabled?.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool enableCache;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool enableCache;
|
||||
/// <summary>Graphics enabled?.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool enableGraphics;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool enableGraphics;
|
||||
/// <summary>Length in sectors of DOS.</summary>
|
||||
public byte dosLength;
|
||||
/// <summary>Length in sectors of FONT file.</summary>
|
||||
@@ -312,8 +353,7 @@ namespace DiscImageChef.PartPlugins
|
||||
/// <summary>Keyboard click volume.</summary>
|
||||
public byte keyboardVolume;
|
||||
/// <summary>Auto-repeat enabled?.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool autorepeat;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool autorepeat;
|
||||
/// <summary>Auto-repeat lead-in.</summary>
|
||||
public byte autorepeatLeadIn;
|
||||
/// <summary>Auto-repeat interval.</summary>
|
||||
@@ -321,18 +361,15 @@ namespace DiscImageChef.PartPlugins
|
||||
/// <summary>Microscreen mode.</summary>
|
||||
public byte microscreenMode;
|
||||
/// <summary>Spare area for keyboard values expansion.</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
|
||||
public byte[] spareKeyboard;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)] public byte[] spareKeyboard;
|
||||
/// <summary>Screen line mode.</summary>
|
||||
public byte lineMode;
|
||||
/// <summary>Screen line width.</summary>
|
||||
public byte lineWidth;
|
||||
/// <summary>Screen disabled?.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool imageOff;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool imageOff;
|
||||
/// <summary>Spare area for screen values expansion.</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 13)]
|
||||
public byte[] spareScreen;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 13)] public byte[] spareScreen;
|
||||
/// <summary>TX baud rate.</summary>
|
||||
public byte txBaudRate;
|
||||
/// <summary>RX baud rate.</summary>
|
||||
@@ -344,16 +381,13 @@ namespace DiscImageChef.PartPlugins
|
||||
/// <summary>Stop bits.</summary>
|
||||
public byte stopBits;
|
||||
/// <summary>Parity enabled?.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool parityCheck;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool parityCheck;
|
||||
/// <summary>Parity type.</summary>
|
||||
public byte parityType;
|
||||
/// <summary>Xon/Xoff enabled on TX.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool txXonXoff;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool txXonXoff;
|
||||
/// <summary>Xon/Xoff enabled on RX.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool rxXonXoff;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool rxXonXoff;
|
||||
/// <summary>Xon character.</summary>
|
||||
public byte xonCharacter;
|
||||
/// <summary>Xoff character.</summary>
|
||||
@@ -361,63 +395,45 @@ namespace DiscImageChef.PartPlugins
|
||||
/// <summary>Xon/Xoff buffer on RX.</summary>
|
||||
public ushort rxXonXoffBuffer;
|
||||
/// <summary>DTR/DSR enabled?.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool dtrDsr;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool dtrDsr;
|
||||
/// <summary>CTS/RTS enabled?.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool ctsRts;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool ctsRts;
|
||||
/// <summary>NULLs after CR.</summary>
|
||||
public byte nullsAfterCr;
|
||||
/// <summary>NULLs after 0xFF.</summary>
|
||||
public byte nullsAfterFF;
|
||||
/// <summary>Send LF after CR in serial port.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool lfAfterCRSerial;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool lfAfterCRSerial;
|
||||
/// <summary>BIOS error report in serial port.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool biosErrorReportSerial;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool biosErrorReportSerial;
|
||||
/// <summary>Spare area for serial port values expansion.</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 13)]
|
||||
public byte[] spareSerial;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 13)] public byte[] spareSerial;
|
||||
/// <summary>Send LF after CR in parallel port.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool lfAfterCrParallel;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool lfAfterCrParallel;
|
||||
/// <summary>Select line supported?.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool selectLine;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool selectLine;
|
||||
/// <summary>Paper empty supported?.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool paperEmpty;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool paperEmpty;
|
||||
/// <summary>Fault line supported?.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool faultLine;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool faultLine;
|
||||
/// <summary>BIOS error report in parallel port.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool biosErrorReportParallel;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool biosErrorReportParallel;
|
||||
/// <summary>Spare area for parallel port values expansion.</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
|
||||
public byte[] spareParallel;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)] public byte[] spareParallel;
|
||||
/// <summary>Spare area for Winchester values expansion.</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)]
|
||||
public byte[] spareWinchester;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)] public byte[] spareWinchester;
|
||||
/// <summary>Parking enabled?.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool parkingEnabled;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool parkingEnabled;
|
||||
/// <summary>Format protection?.</summary>
|
||||
[MarshalAs(UnmanagedType.U1)]
|
||||
public bool formatProtection;
|
||||
[MarshalAs(UnmanagedType.U1)] public bool formatProtection;
|
||||
/// <summary>Spare area for RAM disk values expansion.</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
||||
public byte[] spareRamDisk;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] spareRamDisk;
|
||||
/// <summary>List of bad blocks.</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public ushort[] badBlocks;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public ushort[] badBlocks;
|
||||
/// <summary>Array of partition BPBs.</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
|
||||
public ApricotParameterBlock[] partitions;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public ApricotParameterBlock[] partitions;
|
||||
/// <summary>Spare area.</summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 63)]
|
||||
public byte[] spare;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 63)] public byte[] spare;
|
||||
/// <summary>CP/M double side indicator?.</summary>
|
||||
public bool cpmDoubleSided;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user