mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Update to new DIC version (#167)
* Remove `.` handling code since it should be in DIC now * Add support for 3 new flags * Fix dot tests * Fix PS4 autodetect (Fixes #164) * Fix PS4 version finding * Update DIC archive path * Add support for disk command (unused by default)
This commit is contained in:
@@ -24,6 +24,7 @@ namespace DICUI.Utilities
|
||||
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 @@ namespace DICUI.Utilities
|
||||
// Non-optical
|
||||
case DICCommand.Floppy:
|
||||
return MediaType.FloppyDisk;
|
||||
case DICCommand.Disk:
|
||||
return MediaType.HardDisk;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@@ -532,6 +535,8 @@ namespace DICUI.Utilities
|
||||
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 @@ namespace DICUI.Utilities
|
||||
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 @@ namespace DICUI.Utilities
|
||||
return DICFlagStrings.SubchannelReadLevel;
|
||||
case DICFlag.VideoNow:
|
||||
return DICFlagStrings.VideoNow;
|
||||
case DICFlag.VideoNowColor:
|
||||
return DICFlagStrings.VideoNowColor;
|
||||
|
||||
case DICFlag.NONE:
|
||||
default:
|
||||
|
||||
@@ -257,10 +257,9 @@ namespace DICUI.Utilities
|
||||
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())
|
||||
|
||||
@@ -252,6 +252,7 @@ namespace DICUI.Utilities
|
||||
|| 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 @@ namespace DICUI.Utilities
|
||||
|| 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 @@ namespace DICUI.Utilities
|
||||
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 @@ namespace DICUI.Utilities
|
||||
|
||||
// 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 @@ namespace DICUI.Utilities
|
||||
}
|
||||
}
|
||||
|
||||
// VideoNow Color
|
||||
if (Command == DICCommand.CompactDisc)
|
||||
{
|
||||
if (this[DICFlag.VideoNowColor])
|
||||
parameters.Add(DICFlag.VideoNowColor.LongName());
|
||||
}
|
||||
|
||||
return string.Join(" ", parameters);
|
||||
}
|
||||
|
||||
@@ -830,6 +847,23 @@ namespace DICUI.Utilities
|
||||
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 @@ namespace DICUI.Utilities
|
||||
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 @@ namespace DICUI.Utilities
|
||||
|
||||
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 @@ namespace DICUI.Utilities
|
||||
i++;
|
||||
break;
|
||||
|
||||
case DICFlagStrings.VideoNowColor:
|
||||
if (parts[0] != DICCommandStrings.CompactDisc)
|
||||
return false;
|
||||
|
||||
this[DICFlag.VideoNowColor] = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -1516,6 +1565,9 @@ namespace DICUI.Utilities
|
||||
case MediaType.FloppyDisk:
|
||||
Command = DICCommand.Floppy;
|
||||
return;
|
||||
case MediaType.HardDisk:
|
||||
Command = DICCommand.Disk;
|
||||
return;
|
||||
|
||||
default:
|
||||
Command = DICCommand.NONE;
|
||||
@@ -1571,12 +1623,17 @@ namespace DICUI.Utilities
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user