mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Add DIC merge command and skip sector flag
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
public const string Floppy = "fd";
|
||||
public const string GDROM = "gd";
|
||||
public const string MDS = "mds";
|
||||
public const string Merge = "merge";
|
||||
public const string Reset = "reset";
|
||||
public const string Start = "start";
|
||||
public const string Stop = "stop";
|
||||
@@ -53,6 +54,7 @@
|
||||
public const string ScanFileProtect = "/sf";
|
||||
public const string ScanSectorProtect = "/ss";
|
||||
public const string SeventyFour = "/74";
|
||||
public const string SkipSector = "/sk";
|
||||
public const string SubchannelReadLevel = "/s";
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
Floppy,
|
||||
GDROM,
|
||||
MDS,
|
||||
Merge,
|
||||
Reset,
|
||||
Start,
|
||||
Stop,
|
||||
@@ -55,6 +56,7 @@
|
||||
ScanFileProtect,
|
||||
ScanSectorProtect,
|
||||
SeventyFour,
|
||||
SkipSector,
|
||||
SubchannelReadLevel,
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,8 @@ namespace DICUI.Utilities
|
||||
return DICCommandStrings.GDROM;
|
||||
case DICCommand.MDS:
|
||||
return DICCommandStrings.MDS;
|
||||
case DICCommand.Merge:
|
||||
return DICCommandStrings.Merge;
|
||||
case DICCommand.Reset:
|
||||
return DICCommandStrings.Reset;
|
||||
case DICCommand.Start:
|
||||
@@ -178,6 +180,8 @@ namespace DICUI.Utilities
|
||||
return DICFlagStrings.ScanSectorProtect;
|
||||
case DICFlag.SeventyFour:
|
||||
return DICFlagStrings.SeventyFour;
|
||||
case DICFlag.SkipSector:
|
||||
return DICFlagStrings.SkipSector;
|
||||
case DICFlag.SubchannelReadLevel:
|
||||
return DICFlagStrings.SubchannelReadLevel;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace DICUI.Utilities
|
||||
|
||||
// Path Information
|
||||
public string Filename;
|
||||
public string OptiarcFilename;
|
||||
|
||||
// Sector Information
|
||||
public int? StartLBAValue;
|
||||
@@ -52,6 +53,7 @@ namespace DICUI.Utilities
|
||||
//public int? C2OpcodeValue4; // Last LBA to reread (default EOS)
|
||||
public int? ForceUnitAccessValue; // Delete per specified (default 1)
|
||||
public int? ScanFileProtectValue; // Timeout value (default 60)
|
||||
public int?[] SkipSectorValue = new int?[2]; // Skip between sectors
|
||||
public int? SubchannelReadLevelValue; // 0 no next sub, 1 next sub (default), 2 next and next next
|
||||
|
||||
/// <summary>
|
||||
@@ -219,6 +221,7 @@ namespace DICUI.Utilities
|
||||
|| Command == DICCommand.Floppy
|
||||
|| Command == DICCommand.GDROM
|
||||
|| Command == DICCommand.MDS
|
||||
|| Command == DICCommand.Merge
|
||||
|| Command == DICCommand.Swap
|
||||
|| Command == DICCommand.Sub
|
||||
|| Command == DICCommand.XBOX
|
||||
@@ -232,6 +235,15 @@ namespace DICUI.Utilities
|
||||
return null;
|
||||
}
|
||||
|
||||
// Optiarc Filename
|
||||
if (Command == DICCommand.Merge)
|
||||
{
|
||||
if (OptiarcFilename != null)
|
||||
parameters.Add("\"" + OptiarcFilename.Trim('"') + "\"");
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
// Drive Speed
|
||||
if (Command == DICCommand.Audio
|
||||
|| Command == DICCommand.BluRay
|
||||
@@ -517,6 +529,27 @@ namespace DICUI.Utilities
|
||||
parameters.Add(DICFlag.SeventyFour.Name());
|
||||
}
|
||||
|
||||
// Skip sectors
|
||||
if (Command == DICCommand.Data)
|
||||
{
|
||||
if (this[DICFlag.SkipSector])
|
||||
{
|
||||
if (SkipSectorValue[0] != null && SkipSectorValue[1] != null)
|
||||
{
|
||||
parameters.Add(DICFlag.SkipSector.Name());
|
||||
if (SkipSectorValue[0] >= 0 && SkipSectorValue[1] >= 0)
|
||||
{
|
||||
parameters.Add(SkipSectorValue[0].ToString());
|
||||
parameters.Add(SkipSectorValue[1].ToString());
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Set Subchannel read level
|
||||
if (Command == DICCommand.Audio
|
||||
|| Command == DICCommand.CompactDisc
|
||||
@@ -779,6 +812,23 @@ namespace DICUI.Utilities
|
||||
Command = DICCommand.MDS;
|
||||
break;
|
||||
|
||||
case DICCommandStrings.Merge:
|
||||
if (!DoesExist(parts, 1) || IsFlag(parts[1]) || !File.Exists(parts[1]))
|
||||
return false;
|
||||
else
|
||||
Filename = parts[1];
|
||||
|
||||
if (!DoesExist(parts, 2) || IsFlag(parts[2]) || !File.Exists(parts[2]))
|
||||
return false;
|
||||
else
|
||||
OptiarcFilename = parts[2];
|
||||
|
||||
if (parts.Count > 3)
|
||||
return false;
|
||||
|
||||
Command = DICCommand.Merge;
|
||||
break;
|
||||
|
||||
case DICCommandStrings.Reset:
|
||||
if (!DoesExist(parts, 1) || !IsValidDriveLetter(parts[1]))
|
||||
return false;
|
||||
@@ -1150,6 +1200,22 @@ namespace DICUI.Utilities
|
||||
this[DICFlag.SeventyFour] = true;
|
||||
break;
|
||||
|
||||
case DICFlagStrings.SkipSector:
|
||||
if (parts[0] != DICCommandStrings.Data)
|
||||
return false;
|
||||
else if (!DoesExist(parts, i + 1) || !DoesExist(parts, i + 2))
|
||||
return false;
|
||||
else if (IsFlag(parts[i + 1]) || IsFlag(parts[i + 2]))
|
||||
return false;
|
||||
else if (!IsValidNumber(parts[i + 1], lowerBound: 0) || !IsValidNumber(parts[i + 2], lowerBound: 0))
|
||||
return false;
|
||||
|
||||
this[DICFlag.SkipSector] = true;
|
||||
SkipSectorValue[0] = Int32.Parse(parts[i + 1]);
|
||||
SkipSectorValue[1] = Int32.Parse(parts[i + 2]);
|
||||
i += 2;
|
||||
break;
|
||||
|
||||
case DICFlagStrings.SubchannelReadLevel:
|
||||
if (parts[0] != DICCommandStrings.Audio
|
||||
&& parts[0] != DICCommandStrings.CompactDisc
|
||||
|
||||
Reference in New Issue
Block a user