Update to DIC 20250501

This commit is contained in:
Matt Nadareski
2025-05-01 10:27:31 -04:00
parent adfa8a9a0c
commit bfaf24c237
7 changed files with 143 additions and 20 deletions

View File

@@ -36,6 +36,7 @@
- Fix package reference layout
- Update Nuget packages
- Normalize Shift-JIS characters, when possible
- Update to DIC 20250501
### 3.3.0 (2025-01-03)

View File

@@ -90,10 +90,10 @@ namespace MPF.ExecutionContexts.Test
#region Audio
[Theory]
[InlineData("audio F filename.bin 0 1 2 /be raw /c2 1 2 3 1 5 6 /d8 /d /q /f 0 /np /nq /nr /r /am /sf 1 /ss /sk 1 0 /s 0 /t")]
[InlineData("audio F filename.bin 0 1 2 /be raw /c2 1 2 3 1 5 6 /c2new 1 /d8 /d /q /f 0 /np /nq /nr /r /am /sf 1 /ss /sk 1 0 /s 0 /t")]
public void AudioTest(string parameters)
{
string? expected = "audio F \"filename.bin\" 0 1 2 /be raw /c2 1 2 3 1 5 6 /d8 /d /q /f 0 /np /nq /nr /r /am /sf 1 /ss /sk 1 0 /s 0 /t";
string? expected = "audio F \"filename.bin\" 0 1 2 /be raw /c2 1 2 3 1 5 6 /c2new 1 /d8 /d /q /f 0 /np /nq /nr /r /am /sf 1 /ss /sk 1 0 /s 0 /t";
var context = new ExecutionContext(parameters);
string? actual = context.GenerateParameters();
Assert.Equal(expected, actual);
@@ -135,10 +135,10 @@ namespace MPF.ExecutionContexts.Test
#region CompactDisc
[Theory]
[InlineData("cd f filename.bin 0 /a 0 /p /aj /be raw /c2 1 2 3 1 5 6 /d8 /d /q /mscf /f 0 /fulltoc /mr 0 /np /nq /nl /ns /nr /am /sf 1 /ss /74 /s 0 /toc /trp /vn 0 /vnc /vnx")]
[InlineData("cd f filename.bin 0 /a 0 /p /aj /be raw /c2 1 2 3 1 5 6 /c2new 1 /d8 /d /q /mscf /fdesc sync edc /f 0 /fulltoc /mr 0 /np /nq /nl /ns /nr /am /sf 1 /ss /74 /s 0 /toc /trp /vn 0 /vnc /vnx")]
public void CompactDiscTest(string parameters)
{
string? expected = "cd f \"filename.bin\" 0 /a 0 /p /aj /be raw /c2 1 2 3 1 5 6 /d8 /d /q /mscf /f 0 /fulltoc /mr 0 /np /nq /nl /ns /nr /am /sf 1 /ss /74 /s 0 /toc /trp /vn 0 /vnc /vnx";
string? expected = "cd f \"filename.bin\" 0 /a 0 /p /aj /be raw /c2 1 2 3 1 5 6 /c2new 1 /d8 /d /q /mscf /fdesc sync edc /f 0 /fulltoc /mr 0 /np /nq /nl /ns /nr /am /sf 1 /ss /74 /s 0 /toc /trp /vn 0 /vnc /vnx";
var context = new ExecutionContext(parameters);
string? actual = context.GenerateParameters();
Assert.Equal(expected, actual);
@@ -150,10 +150,10 @@ namespace MPF.ExecutionContexts.Test
#region Data
[Theory]
[InlineData("data F filename.bin 0 1 2 /be raw /c2 1 2 3 1 5 6 /d8 /d /q /f 0 /np /nq /nr /r /am /sf 1 /ss /sk 1 0 /s 0 /t")]
[InlineData("data F filename.bin 0 1 2 /be raw /c2 1 2 3 1 5 6 /c2new 1 /d8 /d /q /f 0 /np /nq /nr /r /am /sf 1 /ss /sk 1 0 /s 0 /t")]
public void DataTest(string parameters)
{
string? expected = "data F \"filename.bin\" 0 1 2 /be raw /c2 1 2 3 1 5 6 /d8 /d /q /f 0 /np /nq /nr /r /am /sf 1 /ss /sk 1 0 /s 0 /t";
string? expected = "data F \"filename.bin\" 0 1 2 /be raw /c2 1 2 3 1 5 6 /c2new 1 /d8 /d /q /f 0 /np /nq /nr /r /am /sf 1 /ss /sk 1 0 /s 0 /t";
var context = new ExecutionContext(parameters);
string? actual = context.GenerateParameters();
Assert.Equal(expected, actual);
@@ -240,10 +240,10 @@ namespace MPF.ExecutionContexts.Test
#region GDROM
[Theory]
[InlineData("gd f filename.bin 0 /be raw /c2 1 2 3 1 5 6 /d8 /d /q /f 0 /np /nq /nr /s 0")]
[InlineData("gd f filename.bin 0 /be raw /c2 1 2 3 1 5 6 /c2new 1 /d8 /d /q /f 0 /np /nq /nr /s 0")]
public void GDROMTest(string parameters)
{
string? expected = "gd f \"filename.bin\" 0 /be raw /c2 1 2 3 1 5 6 /d8 /d /q /f 0 /np /nq /nr /s 0";
string? expected = "gd f \"filename.bin\" 0 /be raw /c2 1 2 3 1 5 6 /c2new 1 /d8 /d /q /f 0 /np /nq /nr /s 0";
var context = new ExecutionContext(parameters);
string? actual = context.GenerateParameters();
Assert.Equal(expected, actual);
@@ -360,10 +360,10 @@ namespace MPF.ExecutionContexts.Test
#region Swap
[Theory]
[InlineData("swap f filename.bin 0 /a 0 /be raw /c2 1 2 3 1 5 6 /d8 /d /q /f 0 /np /nq /nl /ns /nr /am /sf 1 /ss /74 /s 0 /trp /vn 0 /vnc /vnx")]
[InlineData("swap f filename.bin 0 /a 0 /be raw /c2 1 2 3 1 5 6 /c2new 1 /d8 /d /q /f 0 /np /nq /nl /ns /nr /am /sf 1 /ss /74 /s 0 /trp /vn 0 /vnc /vnx")]
public void SwapTest(string parameters)
{
string? expected = "swap f \"filename.bin\" 0 /a 0 /be raw /c2 1 2 3 1 5 6 /d8 /d /q /f 0 /np /nq /nl /ns /nr /am /sf 1 /ss /74 /s 0 /trp /vn 0 /vnc /vnx";
string? expected = "swap f \"filename.bin\" 0 /a 0 /be raw /c2 1 2 3 1 5 6 /c2new 1 /d8 /d /q /f 0 /np /nq /nl /ns /nr /am /sf 1 /ss /74 /s 0 /trp /vn 0 /vnc /vnx";
var context = new ExecutionContext(parameters);
string? actual = context.GenerateParameters();
Assert.Equal(expected, actual);

View File

@@ -97,6 +97,13 @@ namespace MPF.ExecutionContexts.DiscImageCreator
/// </summary>
public int? FixValue { get; set; }
/// <summary>
/// Force descramble value
/// Possible values: sync, edc, sync edc, ecc, sync ecc, edc ecc
/// </summary>
/// TODO: Make this an enum
public string? ForceDescrambleSectorValue { get; set; }
/// <summary>
/// Set the force unit access flag value (default 1)
/// </summary>
@@ -185,6 +192,7 @@ namespace MPF.ExecutionContexts.DiscImageCreator
[
FlagStrings.BEOpcode,
FlagStrings.C2Opcode,
FlagStrings.C2OpcodeNew,
FlagStrings.D8Opcode,
FlagStrings.DatExpand,
FlagStrings.DisableBeep,
@@ -220,10 +228,12 @@ namespace MPF.ExecutionContexts.DiscImageCreator
FlagStrings.AtariJaguar,
FlagStrings.BEOpcode,
FlagStrings.C2Opcode,
FlagStrings.C2OpcodeNew,
FlagStrings.D8Opcode,
FlagStrings.DatExpand,
FlagStrings.DisableBeep,
FlagStrings.ExtractMicroSoftCabFile,
FlagStrings.ForceDescrambleSector,
FlagStrings.ForceUnitAccess,
FlagStrings.FullToc,
FlagStrings.MultiSectorRead,
@@ -248,6 +258,7 @@ namespace MPF.ExecutionContexts.DiscImageCreator
[
FlagStrings.BEOpcode,
FlagStrings.C2Opcode,
FlagStrings.C2OpcodeNew,
FlagStrings.D8Opcode,
FlagStrings.DatExpand,
FlagStrings.DisableBeep,
@@ -300,6 +311,7 @@ namespace MPF.ExecutionContexts.DiscImageCreator
[
FlagStrings.BEOpcode,
FlagStrings.C2Opcode,
FlagStrings.C2OpcodeNew,
FlagStrings.D8Opcode,
FlagStrings.DatExpand,
FlagStrings.DisableBeep,
@@ -333,6 +345,7 @@ namespace MPF.ExecutionContexts.DiscImageCreator
FlagStrings.AddOffset,
FlagStrings.BEOpcode,
FlagStrings.C2Opcode,
FlagStrings.C2OpcodeNew,
FlagStrings.D8Opcode,
FlagStrings.DatExpand,
FlagStrings.DisableBeep,
@@ -594,6 +607,22 @@ namespace MPF.ExecutionContexts.DiscImageCreator
}
}
// C2 Opcode New
if (IsFlagSupported(FlagStrings.C2OpcodeNew))
{
if (this[FlagStrings.C2OpcodeNew] == true)
{
parameters.Append($"{FlagStrings.C2OpcodeNew} ");
if (C2OpcodeValue[0] != null)
{
if (C2OpcodeValue[0] > 0)
parameters.Append($"{C2OpcodeValue[0]} ");
else
return null;
}
}
}
// Copyright Management Information
if (IsFlagSupported(FlagStrings.CopyrightManagementInformation))
{
@@ -653,6 +682,19 @@ namespace MPF.ExecutionContexts.DiscImageCreator
}
}
// Force Descramble Sector
if (IsFlagSupported(FlagStrings.ForceDescrambleSector))
{
if (this[FlagStrings.ForceDescrambleSector] == true)
{
parameters.Append($"{FlagStrings.ForceDescrambleSector} ");
if (ForceDescrambleSectorValue != null)
parameters.Append($"{ForceDescrambleSectorValue} ");
else
return null;
}
}
// Force Unit Access
if (IsFlagSupported(FlagStrings.ForceUnitAccess))
{
@@ -974,6 +1016,7 @@ namespace MPF.ExecutionContexts.DiscImageCreator
C2OpcodeValue = new int?[6];
DVDRereadValue = null;
FixValue = null;
ForceDescrambleSectorValue = null;
ForceUnitAccessValue = null;
NoSkipSecuritySectorValue = null;
ScanFileProtectValue = null;
@@ -1531,6 +1574,25 @@ namespace MPF.ExecutionContexts.DiscImageCreator
}
}
// C2 Opcode New
if (parts[i] == FlagStrings.C2OpcodeNew && IsFlagSupported(FlagStrings.C2OpcodeNew))
{
this[FlagStrings.C2OpcodeNew] = true;
if (!DoesExist(parts, i + 1))
{
return false;
}
else if (!IsValidInt32(parts[i + 1], lowerBound: 0))
{
return false;
}
else
{
C2OpcodeValue[0] = int.Parse(parts[i + 1]);
i++;
}
}
// Copyright Management Information
ProcessFlagParameter(parts, FlagStrings.CopyrightManagementInformation, ref i);
@@ -1556,6 +1618,63 @@ namespace MPF.ExecutionContexts.DiscImageCreator
if (intValue != null && intValue != int.MinValue)
FixValue = intValue;
// Force Descramble Sector
stringValue = ProcessStringParameter(parts, FlagStrings.ForceDescrambleSector, ref i);
if (!string.IsNullOrEmpty(stringValue))
{
if (string.Equals(stringValue, "sync"))
{
if (DoesExist(parts, i + 1))
{
if (parts[i + 1] == "edc")
{
ForceDescrambleSectorValue = "sync edc";
i++;
}
else if (parts[i + 1] == "ecc")
{
ForceDescrambleSectorValue = "sync ecc";
i++;
}
else
{
ForceDescrambleSectorValue = "sync";
}
}
else
{
ForceDescrambleSectorValue = "sync";
}
}
else if (string.Equals(stringValue, "edc"))
{
if (DoesExist(parts, i + 1))
{
if (parts[i + 1] == "ecc")
{
ForceDescrambleSectorValue = "edc ecc";
i++;
}
else
{
ForceDescrambleSectorValue = "edc";
}
}
else
{
ForceDescrambleSectorValue = "edc";
}
}
else if (string.Equals(stringValue, "ecc"))
{
ForceDescrambleSectorValue = "ecc";
}
else
{
return false;
}
}
// Force Unit Access
intValue = ProcessInt32Parameter(parts, FlagStrings.ForceUnitAccess, ref i, missingAllowed: true);
if (intValue != null && intValue != int.MinValue && intValue >= 0)

View File

@@ -10,6 +10,7 @@ namespace MPF.ExecutionContexts.DiscImageCreator
public const string AtariJaguar = "/aj";
public const string BEOpcode = "/be";
public const string C2Opcode = "/c2";
public const string C2OpcodeNew = "/c2new";
public const string CopyrightManagementInformation = "/c";
public const string D8Opcode = "/d8";
public const string DatExpand = "/d";
@@ -17,6 +18,7 @@ namespace MPF.ExecutionContexts.DiscImageCreator
public const string DVDReread = "/rr";
public const string ExtractMicroSoftCabFile = "/mscf";
public const string Fix = "/fix";
public const string ForceDescrambleSector = "/fdesc";
public const string ForceUnitAccess = "/f";
public const string FullToc = "/fulltoc";
public const string MultiSectorRead = "/mr";

View File

@@ -9,6 +9,7 @@ namespace MPF.Frontend.Test
[InlineData(null, 'D', false, MediaType.NONE, false)]
[InlineData("", 'D', false, MediaType.NONE, false)]
[InlineData("cd F test.bin 8 /c2 20", 'F', false, MediaType.CDROM, true)]
[InlineData("cd F test.bin 8 /c2new 20", 'F', false, MediaType.CDROM, true)]
[InlineData("fd A test.img", 'A', true, MediaType.FloppyDisk, true)]
[InlineData("dvd X test.iso 8 /raw", 'X', false, MediaType.FloppyDisk, false)]
[InlineData("stop D", 'D', false, MediaType.DVD, true)]

View File

@@ -91,12 +91,12 @@ function download_programs() {
# DiscImageCreator
DL_MAP["Creator_linux-arm64"]=""
DL_MAP["Creator_linux-x64"]="https://github.com/user-attachments/files/18285720/DiscImageCreator_20250101.tar.gz"
DL_MAP["Creator_osx-arm64"]="https://github.com/user-attachments/files/18285727/DiscImageCreator_20250101.zip"
DL_MAP["Creator_osx-x64"]="https://github.com/user-attachments/files/18285727/DiscImageCreator_20250101.zip"
DL_MAP["Creator_linux-x64"]="https://github.com/user-attachments/files/20000183/DiscImageCreator_20250501.tar.gz"
DL_MAP["Creator_osx-arm64"]="https://github.com/user-attachments/files/20000184/DiscImageCreator_20250501.zip"
DL_MAP["Creator_osx-x64"]="https://github.com/user-attachments/files/20000184/DiscImageCreator_20250501.zip"
DL_MAP["Creator_win-arm64"]=""
DL_MAP["Creator_win-x86"]="https://github.com/user-attachments/files/18287520/DiscImageCreator_20250101.zip"
DL_MAP["Creator_win-x64"]="https://github.com/user-attachments/files/18287520/DiscImageCreator_20250101.zip"
DL_MAP["Creator_win-x86"]="https://github.com/user-attachments/files/20000181/DiscImageCreator_20250501.zip"
DL_MAP["Creator_win-x64"]="https://github.com/user-attachments/files/20000181/DiscImageCreator_20250501.zip"
# Redumper
DL_MAP["Redumper_linux-arm64"]=""

View File

@@ -80,12 +80,12 @@ function Download-Programs {
# DiscImageCreator
"Creator_linux-arm64" = ""
"Creator_linux-x64" = "https://github.com/user-attachments/files/18285720/DiscImageCreator_20250101.tar.gz"
"Creator_osx-arm64" = "https://github.com/user-attachments/files/18285727/DiscImageCreator_20250101.zip"
"Creator_osx-x64" = "https://github.com/user-attachments/files/18285727/DiscImageCreator_20250101.zip"
"Creator_linux-x64" = "https://github.com/user-attachments/files/20000183/DiscImageCreator_20250501.tar.gz"
"Creator_osx-arm64" = "https://github.com/user-attachments/files/20000184/DiscImageCreator_20250501.zip"
"Creator_osx-x64" = "https://github.com/user-attachments/files/20000184/DiscImageCreator_20250501.zip"
"Creator_win-arm64" = ""
"Creator_win-x86" = "https://github.com/user-attachments/files/18287520/DiscImageCreator_20250101.zip"
"Creator_win-x64" = "https://github.com/user-attachments/files/18287520/DiscImageCreator_20250101.zip"
"Creator_win-x86" = "https://github.com/user-attachments/files/20000181/DiscImageCreator_20250501.zip"
"Creator_win-x64" = "https://github.com/user-attachments/files/20000181/DiscImageCreator_20250501.zip"
# Redumper
"Redumper_linux-arm64" = ""