diff --git a/DICUI.Library/Data/Constants.cs b/DICUI.Library/Data/Constants.cs index 2768e321..dd269887 100644 --- a/DICUI.Library/Data/Constants.cs +++ b/DICUI.Library/Data/Constants.cs @@ -11,6 +11,7 @@ public static class DICCommandStrings public const string CompactDisc = "cd"; public const string Data = "data"; public const string DigitalVideoDisc = "dvd"; + public const string Disk = "disk"; public const string DriveSpeed = "ls"; public const string Eject = "eject"; public const string Floppy = "fd"; @@ -36,6 +37,7 @@ public static class DICFlagStrings { public const string AddOffset = "/a"; public const string AMSF = "/p"; + public const string AtariJaguar = "/aj"; public const string BEOpcode = "/be"; public const string C2Opcode = "/c2"; public const string CopyrightManagementInformation = "/c"; @@ -59,6 +61,7 @@ public static class DICFlagStrings public const string SkipSector = "/sk"; public const string SubchannelReadLevel = "/s"; public const string VideoNow = "/vn"; + public const string VideoNowColor = "/vnc"; } /// diff --git a/DICUI.Library/Data/Enumerations.cs b/DICUI.Library/Data/Enumerations.cs index ab4bc814..9f0b0b83 100644 --- a/DICUI.Library/Data/Enumerations.cs +++ b/DICUI.Library/Data/Enumerations.cs @@ -30,6 +30,7 @@ public enum DICCommand CompactDisc, Data, DigitalVideoDisc, + Disk, DriveSpeed, Eject, Floppy, @@ -56,6 +57,7 @@ public enum DICFlag NONE = 0, AddOffset, AMSF, + AtariJaguar, BEOpcode, C2Opcode, CopyrightManagementInformation, @@ -79,6 +81,7 @@ public enum DICFlag SkipSector, SubchannelReadLevel, VideoNow, + VideoNowColor, } /// diff --git a/DICUI.Library/Utilities/Converters.cs b/DICUI.Library/Utilities/Converters.cs index c996378f..6eb3b5d5 100644 --- a/DICUI.Library/Utilities/Converters.cs +++ b/DICUI.Library/Utilities/Converters.cs @@ -24,6 +24,7 @@ public static class Converters case DICCommand.CompactDisc: case DICCommand.Data: case DICCommand.DigitalVideoDisc: + case DICCommand.Disk: case DICCommand.Floppy: return KnownSystem.IBMPCCompatible; case DICCommand.GDROM: @@ -239,6 +240,8 @@ public static class Converters // Non-optical case DICCommand.Floppy: return MediaType.FloppyDisk; + case DICCommand.Disk: + return MediaType.HardDisk; default: return null; } @@ -532,6 +535,8 @@ public static string LongName(this DICCommand command) return DICCommandStrings.Data; case DICCommand.DigitalVideoDisc: return DICCommandStrings.DigitalVideoDisc; + case DICCommand.Disk: + return DICCommandStrings.Disk; case DICCommand.DriveSpeed: return DICCommandStrings.DriveSpeed; case DICCommand.Eject: @@ -584,6 +589,8 @@ public static string LongName(this DICFlag flag) return DICFlagStrings.AddOffset; case DICFlag.AMSF: return DICFlagStrings.AMSF; + case DICFlag.AtariJaguar: + return DICFlagStrings.AtariJaguar; case DICFlag.BEOpcode: return DICFlagStrings.BEOpcode; case DICFlag.C2Opcode: @@ -630,6 +637,8 @@ public static string LongName(this DICFlag flag) return DICFlagStrings.SubchannelReadLevel; case DICFlag.VideoNow: return DICFlagStrings.VideoNow; + case DICFlag.VideoNowColor: + return DICFlagStrings.VideoNowColor; case DICFlag.NONE: default: diff --git a/DICUI.Library/Utilities/DumpEnvironment.cs b/DICUI.Library/Utilities/DumpEnvironment.cs index 8e9bdd02..43562352 100644 --- a/DICUI.Library/Utilities/DumpEnvironment.cs +++ b/DICUI.Library/Utilities/DumpEnvironment.cs @@ -257,10 +257,9 @@ public void FixOutputPaths() OutputFilename = Path.GetFileName(combinedPath); // Take care of extra path characters - OutputDirectory = new StringBuilder(OutputDirectory.Replace('.', '_').Replace('&', '_')) + OutputDirectory = new StringBuilder(OutputDirectory.Replace('&', '_')) .Replace(':', '_', 0, OutputDirectory.LastIndexOf(':') == -1 ? 0 : OutputDirectory.LastIndexOf(':')).ToString(); - OutputFilename = new StringBuilder(OutputFilename.Replace('&', '_')) - .Replace('.', '_', 0, OutputFilename.LastIndexOf('.') == -1 ? 0 : OutputFilename.LastIndexOf('.')).ToString(); + OutputFilename = new StringBuilder(OutputFilename.Replace('&', '_')).ToString(); // Sanitize everything else foreach (char c in Path.GetInvalidPathChars()) diff --git a/DICUI.Library/Utilities/Parameters.cs b/DICUI.Library/Utilities/Parameters.cs index 1fb52529..9d7f9ced 100644 --- a/DICUI.Library/Utilities/Parameters.cs +++ b/DICUI.Library/Utilities/Parameters.cs @@ -252,6 +252,7 @@ public string GenerateParameters() || Command == DICCommand.CompactDisc || Command == DICCommand.Data || Command == DICCommand.DigitalVideoDisc + || Command == DICCommand.Disk || Command == DICCommand.DriveSpeed || Command == DICCommand.Eject || Command == DICCommand.Floppy @@ -278,6 +279,7 @@ public string GenerateParameters() || Command == DICCommand.CompactDisc || Command == DICCommand.Data || Command == DICCommand.DigitalVideoDisc + || Command == DICCommand.Disk || Command == DICCommand.Floppy || Command == DICCommand.GDROM || Command == DICCommand.MDS @@ -360,6 +362,13 @@ public string GenerateParameters() parameters.Add(DICFlag.AMSF.LongName()); } + // Atari Jaguar CD + if (Command == DICCommand.CompactDisc) + { + if (this[DICFlag.AtariJaguar]) + parameters.Add(DICFlag.AtariJaguar.LongName()); + } + // BE Opcode if (Command == DICCommand.Audio || Command == DICCommand.CompactDisc @@ -556,7 +565,8 @@ public string GenerateParameters() // Reverse read if (Command == DICCommand.CompactDisc - || Command == DICCommand.Data) + || Command == DICCommand.Data + || Command == DICCommand.DigitalVideoDisc) { if (this[DICFlag.Reverse]) parameters.Add(DICFlag.Reverse.LongName()); @@ -663,6 +673,13 @@ public string GenerateParameters() } } + // VideoNow Color + if (Command == DICCommand.CompactDisc) + { + if (this[DICFlag.VideoNowColor]) + parameters.Add(DICFlag.VideoNowColor.LongName()); + } + return string.Join(" ", parameters); } @@ -830,6 +847,23 @@ private bool ValidateAndSetParameters(string parameters) index = 4; break; + case DICCommandStrings.Disk: + if (!DoesExist(parts, 1) || !IsValidDriveLetter(parts[1])) + return false; + else + DriveLetter = parts[1]; + + if (!DoesExist(parts, 2) || IsFlag(parts[2])) + return false; + else + Filename = parts[2]; + + if (parts.Count > 3) + return false; + + Command = DICCommand.Disk; + break; + case DICCommandStrings.DriveSpeed: if (!DoesExist(parts, 1) || !IsValidDriveLetter(parts[1])) return false; @@ -1087,6 +1121,13 @@ private bool ValidateAndSetParameters(string parameters) this[DICFlag.AMSF] = true; break; + case DICFlagStrings.AtariJaguar: + if (parts[0] != DICCommandStrings.CompactDisc) + return false; + + this[DICFlag.AtariJaguar] = true; + break; + case DICFlagStrings.BEOpcode: if (parts[0] != DICCommandStrings.Audio && parts[0] != DICCommandStrings.CompactDisc @@ -1287,7 +1328,8 @@ private bool ValidateAndSetParameters(string parameters) case DICFlagStrings.Reverse: if (parts[0] != DICCommandStrings.CompactDisc - && parts[0] != DICCommandStrings.Data) + && parts[0] != DICCommandStrings.Data + && parts[0] != DICCommandStrings.DigitalVideoDisc) return false; this[DICFlag.Reverse] = true; @@ -1399,6 +1441,13 @@ private bool ValidateAndSetParameters(string parameters) i++; break; + case DICFlagStrings.VideoNowColor: + if (parts[0] != DICCommandStrings.CompactDisc) + return false; + + this[DICFlag.VideoNowColor] = true; + break; + default: return false; } @@ -1516,6 +1565,9 @@ private void SetBaseCommand(KnownSystem? system, MediaType? type) case MediaType.FloppyDisk: Command = DICCommand.Floppy; return; + case MediaType.HardDisk: + Command = DICCommand.Disk; + return; default: Command = DICCommand.NONE; @@ -1571,12 +1623,17 @@ private void SetDefaultParameters(KnownSystem? system, MediaType? type, bool par SubchannelReadLevelValue = 2; } break; + case KnownSystem.AtariJaguarCD: + this[DICFlag.AtariJaguar] = true; + break; case KnownSystem.HasbroVideoNow: - case KnownSystem.HasbroVideoNowColor: case KnownSystem.HasbroVideoNowJr: this[DICFlag.VideoNow] = true; this.VideoNowValue = 18032; break; + case KnownSystem.HasbroVideoNowColor: + this[DICFlag.VideoNowColor] = true; + break; case KnownSystem.HasbroVideoNowXP: this[DICFlag.VideoNow] = true; this.VideoNowValue = 20832; diff --git a/DICUI.Test/Utilities/DumpEnvironmentTest.cs b/DICUI.Test/Utilities/DumpEnvironmentTest.cs index 9b267a25..5c124586 100644 --- a/DICUI.Test/Utilities/DumpEnvironmentTest.cs +++ b/DICUI.Test/Utilities/DumpEnvironmentTest.cs @@ -31,8 +31,8 @@ public void ParametersValidTest(string parameters, char letter, bool isFloppy, M [InlineData(" ", "", " ", "")] [InlineData("super", "blah.bin", "super", "blah.bin")] [InlineData("super\\hero", "blah.bin", "super\\hero", "blah.bin")] - [InlineData("super.hero", "blah.bin", "super_hero", "blah.bin")] - [InlineData("superhero", "blah.rev.bin", "superhero", "blah_rev.bin")] + [InlineData("super.hero", "blah.bin", "super.hero", "blah.bin")] + [InlineData("superhero", "blah.rev.bin", "superhero", "blah.rev.bin")] [InlineData("super&hero", "blah.bin", "super_hero", "blah.bin")] [InlineData("superhero", "blah&foo.bin", "superhero", "blah_foo.bin")] public void FixOutputPathsTest(string outputDirectory, string outputFilename, string expectedOutputDirectory, string expectedOutputFilename) diff --git a/appveyor.yml b/appveyor.yml index f9e77416..354063fc 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -32,11 +32,11 @@ build: # post-build step after_build: -- ps: appveyor DownloadFile https://github.com/saramibreak/DiscImageCreator/files/3341769/DiscImageCreator_20190627.zip +- ps: appveyor DownloadFile https://github.com/saramibreak/DiscImageCreator/files/3674664/DiscImageCreator_20191001.zip - ps: appveyor DownloadFile https://archive.org/download/subdump_fua_0x28/subdump_fua_0x28.zip -- 7z e DiscImageCreator_20190627.zip -oDICUI\bin\Debug\net462\Programs Release_ANSI\* -- 7z e DiscImageCreator_20190627.zip -oDICUI\bin\Debug\net472\Programs Release_ANSI\* -- 7z e DiscImageCreator_20190627.zip -oDICUI\bin\Debug\netcoreapp3.0\Programs Release_ANSI\* +- 7z e DiscImageCreator_20191001.zip -oDICUI\bin\Debug\net462\Programs Release_ANSI\* +- 7z e DiscImageCreator_20191001.zip -oDICUI\bin\Debug\net472\Programs Release_ANSI\* +- 7z e DiscImageCreator_20191001.zip -oDICUI\bin\Debug\netcoreapp3.0\Programs Release_ANSI\* - 7z e subdump_fua_0x28.zip -oDICUI\bin\Debug\net462 * - mv DICUI\bin\Debug\net462\subdump_fua_0x28.exe DICUI\bin\Debug\net462\subdump.exe - 7z e subdump_fua_0x28.zip -oDICUI\bin\Debug\net472 *