mirror of
https://github.com/SabreTools/MPF.git
synced 2026-02-04 05:35:52 +00:00
Compare commits
84 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e763fec01e | ||
|
|
f960aca8a9 | ||
|
|
1a44fb5c8a | ||
|
|
285921cae3 | ||
|
|
2255dba640 | ||
|
|
99158f31c9 | ||
|
|
53a2ef227b | ||
|
|
c0efc63741 | ||
|
|
905bd1a7dc | ||
|
|
5d49d4833f | ||
|
|
8fd3e2d405 | ||
|
|
1521a918f3 | ||
|
|
5f580ee025 | ||
|
|
9c7cee0aa3 | ||
|
|
d549609a0f | ||
|
|
207fdbb49c | ||
|
|
63e63a0033 | ||
|
|
73be55a645 | ||
|
|
d913aa247e | ||
|
|
d9a9f3bfd4 | ||
|
|
ea3e040b3f | ||
|
|
ed67522675 | ||
|
|
6e3902bbb1 | ||
|
|
3f802e8548 | ||
|
|
c3c4cf6e5b | ||
|
|
39258c4e85 | ||
|
|
df81259fba | ||
|
|
a835c81951 | ||
|
|
af4f3e8444 | ||
|
|
085916e1e6 | ||
|
|
557354c844 | ||
|
|
a23a74ffa4 | ||
|
|
958aeeae32 | ||
|
|
c73ff42500 | ||
|
|
24a93e298b | ||
|
|
ae81bb0743 | ||
|
|
cf7863fbb2 | ||
|
|
5e0e71120d | ||
|
|
5adbdd29e6 | ||
|
|
fd855b9024 | ||
|
|
17c283ff67 | ||
|
|
a37e6aaf18 | ||
|
|
1dbf23ca95 | ||
|
|
2e52d00107 | ||
|
|
eb69b74b4a | ||
|
|
db4a785558 | ||
|
|
9bdd2d6951 | ||
|
|
de48c8f0f9 | ||
|
|
c59f7c2dae | ||
|
|
2740a6a1c1 | ||
|
|
56e8470069 | ||
|
|
a5f1a12aee | ||
|
|
8749b486a8 | ||
|
|
3446957f68 | ||
|
|
cb9813db3d | ||
|
|
6e6b716c18 | ||
|
|
400ef38c60 | ||
|
|
87d5fc0e66 | ||
|
|
d5d8ae0501 | ||
|
|
fae7a5254d | ||
|
|
97be13f020 | ||
|
|
dd0dfc5cf5 | ||
|
|
a7a295434d | ||
|
|
319f5563cb | ||
|
|
939174d8c4 | ||
|
|
1d5d7b265e | ||
|
|
a2ac7222f9 | ||
|
|
4f0b5904c3 | ||
|
|
7ff848347c | ||
|
|
a1c89d17b8 | ||
|
|
3575c43703 | ||
|
|
928c9966fa | ||
|
|
a404a270f1 | ||
|
|
dfba97685a | ||
|
|
8de2f1c9bb | ||
|
|
f57b29615b | ||
|
|
565a9bb09a | ||
|
|
d9d61cf665 | ||
|
|
106f16d703 | ||
|
|
8b600a6a35 | ||
|
|
b251ae7927 | ||
|
|
3a749b67e3 | ||
|
|
3abc277aab | ||
|
|
894f2c6fde |
101
Constants.cs
Normal file
101
Constants.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
namespace DICUI
|
||||
{
|
||||
public static class UIElements
|
||||
{
|
||||
public const string StartDumping = "Start Dumping";
|
||||
public const string StopDumping = "Stop Dumping";
|
||||
}
|
||||
|
||||
public static class DICCommands
|
||||
{
|
||||
// Commands
|
||||
|
||||
public const string CompactDiscCommand = "cd";
|
||||
public const string DataCommand = "data";
|
||||
public const string AudioCommand = "audio";
|
||||
public const string GDROMCommand = "gd";
|
||||
public const string GDROMSwapCommand = "swap";
|
||||
public const string DVDCommand = "dvd";
|
||||
public const string BDCommand = "bd";
|
||||
public const string FloppyCommand = "fd";
|
||||
public const string StopCommand = "stop";
|
||||
public const string StartCommand = "start";
|
||||
public const string EjectCommand = "eject";
|
||||
public const string CloseCommand = "close";
|
||||
public const string ResetCommand = "reset";
|
||||
public const string SubCommand = "sub";
|
||||
public const string MDSCommand = "mds";
|
||||
public const string DriveSpeedCommand = "ls"; // Unlisted in help text
|
||||
|
||||
// DIC Flags
|
||||
|
||||
public const string ForceUnitAccessFlag = "/f";
|
||||
public const string DisableBeepFlag = "/q";
|
||||
public const string CDAddOffsetFlag = "/a";
|
||||
public const string CDBEOpcodeFlag = "/be";
|
||||
public const string CDD8OpcodeFlag = "/d8";
|
||||
public const string CDC2OpcodeFlag = "/c2";
|
||||
public const string CDMCNFlag = "/m";
|
||||
public const string CDAMSFFlag = "/p";
|
||||
public const string CDReverseFlag = "/r";
|
||||
public const string CDMultiSessionFlag = "/ms";
|
||||
public const string CDScanFileProtectFlag = "/sf";
|
||||
public const string CDScanSectorProtectFlag = "/ss";
|
||||
public const string CDScanAnitModFlag = "/am";
|
||||
public const string CDNoFixSubPFlag = "/np";
|
||||
public const string CDNoFixSubQFlag = "/nq";
|
||||
public const string CDNoFixSubRtoWFlag = "/nr";
|
||||
public const string CDNoFixSubQLibCryptFlag = "/nl";
|
||||
public const string CDNoFixSubQSecuROMFlag = "/ns";
|
||||
public const string CDSubchannelReadLevelFlag = "/s";
|
||||
public const string DVDCMIFlag = "/c";
|
||||
public const string DVDRawFlag = "/raw";
|
||||
}
|
||||
|
||||
public static class Template
|
||||
{
|
||||
// Manual information
|
||||
|
||||
public const string TitleField = "Title";
|
||||
public const string DiscNumberField = "Disc Number / Letter";
|
||||
public const string DiscTitleField = "Disc Title";
|
||||
public const string CategoryField = "Category";
|
||||
public const string RegionField = "Region";
|
||||
public const string LanguagesField = "Languages";
|
||||
public const string DiscSerialField = "Disc Serial";
|
||||
public const string BarcodeField = "Barcode";
|
||||
public const string ISBNField = "ISBN";
|
||||
public const string CommentsField = "Comments";
|
||||
public const string ContentsField = "Contents";
|
||||
public const string VersionField = "Version";
|
||||
public const string EditionField = "Edition/Release";
|
||||
public const string CopyProtectionField = "Copy Protection";
|
||||
public const string MasteringRingField = "Mastering Ring";
|
||||
public const string MasteringSIDField = "Mastering SID Code";
|
||||
public const string MouldSIDField = "Mould SID Code";
|
||||
public const string AdditionalMouldField = "Additional Mould";
|
||||
public const string ToolstampField = "Toolstamp or Mastering Code";
|
||||
|
||||
// Automatic Information
|
||||
|
||||
public const string PVDField = "Primary Volume Descriptor (PVD)";
|
||||
public const string DATField = "DAT";
|
||||
public const string ErrorCountField = "Error Count";
|
||||
public const string CuesheetField = "Cuesheet";
|
||||
public const string WriteOffsetField = "WriteOffset";
|
||||
public const string LayerbreakField = "Layerbreak";
|
||||
public const string PlaystationEXEDateField = "EXE Date"; // TODO: Not automatic yet
|
||||
public const string PlayStationEDCField = "EDC"; // TODO: Not automatic yet
|
||||
public const string PlayStationAntiModchipField = "Anti-modchip"; // TODO: Not automatic yet
|
||||
public const string PlayStationLibCryptField = "LibCrypt"; // TODO: Not automatic yet
|
||||
public const string SaturnHeaderField = "Header"; // TODO: Not automatic yet
|
||||
public const string SaturnBuildDateField = "Build Date"; // TODO: Not automatic yet
|
||||
|
||||
// Default values
|
||||
|
||||
public const string RequiredValue = "(REQUIRED)";
|
||||
public const string RequiredIfExistsValue = "(REQUIRED, IF EXISTS)";
|
||||
public const string OptionalValue = "(OPTIONAL)";
|
||||
public const string YesNoValue = "Yes/No";
|
||||
}
|
||||
}
|
||||
@@ -87,6 +87,8 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="Constants.cs" />
|
||||
<Compile Include="Utilities.cs" />
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -95,6 +97,7 @@
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Enumerations.cs" />
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
|
||||
107
Enumerations.cs
Normal file
107
Enumerations.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
namespace DICUI
|
||||
{
|
||||
/// <summary>
|
||||
/// Known disc types
|
||||
/// </summary>
|
||||
public enum DiscType
|
||||
{
|
||||
NONE = 0,
|
||||
CD,
|
||||
DVD5,
|
||||
DVD9,
|
||||
GDROM,
|
||||
HDDVD,
|
||||
BD25,
|
||||
BD50,
|
||||
|
||||
// Special Formats
|
||||
GameCubeGameDisc,
|
||||
UMD,
|
||||
|
||||
// Keeping this separate since it's currently unsupported in the UI
|
||||
Floppy = 99,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Known systems
|
||||
/// </summary>
|
||||
/// <remarks>Ensure that Utilities methods are updated as well</remarks>
|
||||
public enum KnownSystem
|
||||
{
|
||||
NONE = 0,
|
||||
|
||||
#region Consoles
|
||||
|
||||
BandaiPlaydiaQuickInteractiveSystem,
|
||||
BandaiApplePippin,
|
||||
CommodoreAmigaCD32,
|
||||
CommodoreAmigaCDTV,
|
||||
MattelHyperscan,
|
||||
MicrosoftXBOX,
|
||||
MicrosoftXBOX360,
|
||||
MicrosoftXBOXOne,
|
||||
NECPCEngineTurboGrafxCD,
|
||||
NECPCFX,
|
||||
NintendoGameCube,
|
||||
NintendoWii,
|
||||
NintendoWiiU,
|
||||
Panasonic3DOInteractiveMultiplayer,
|
||||
PhilipsCDi,
|
||||
SegaCDMegaCD,
|
||||
SegaDreamcast,
|
||||
SegaSaturn,
|
||||
SNKNeoGeoCD,
|
||||
SonyPlayStation,
|
||||
SonyPlayStation2,
|
||||
SonyPlayStation3,
|
||||
SonyPlayStation4,
|
||||
SonyPlayStationPortable,
|
||||
VMLabsNuon,
|
||||
VTechVFlashVSmilePro,
|
||||
ZAPiTGamesGameWaveFamilyEntertainmentSystem,
|
||||
|
||||
#endregion
|
||||
|
||||
#region Computers
|
||||
|
||||
AcornArchimedes,
|
||||
AppleMacintosh,
|
||||
CommodoreAmigaCD,
|
||||
FujitsuFMTowns,
|
||||
IBMPCCompatible,
|
||||
NECPC88,
|
||||
NECPC98,
|
||||
SharpX68000,
|
||||
|
||||
#endregion
|
||||
|
||||
#region Arcade
|
||||
|
||||
NamcoSegaNintendoTriforce,
|
||||
NamcoSystem246,
|
||||
SegaChihiro,
|
||||
SegaLindbergh,
|
||||
SegaNaomi,
|
||||
SegaNaomi2,
|
||||
TABAustriaQuizard,
|
||||
TandyMemorexVisualInformationSystem,
|
||||
|
||||
#endregion
|
||||
|
||||
#region Other
|
||||
|
||||
AudioCD,
|
||||
BDVideo,
|
||||
DVDVideo,
|
||||
EnhancedCD,
|
||||
PalmOS,
|
||||
PhilipsCDiDigitalVideo,
|
||||
PhotoCD,
|
||||
PlayStationGameSharkUpdates,
|
||||
TaoiKTV,
|
||||
TomyKissSite,
|
||||
VideoCD,
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -37,70 +37,23 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.Row="0" Grid.Column="0" VerticalAlignment="Center">Disc Type</Label>
|
||||
<Label Grid.Row="1" Grid.Column="0" VerticalAlignment="Center">DiscImageCreator Path</Label>
|
||||
<Label Grid.Row="2" Grid.Column="0" VerticalAlignment="Center">Output Filename</Label>
|
||||
<Label Grid.Row="3" Grid.Column="0" VerticalAlignment="Center">Output Directory</Label>
|
||||
<Label Grid.Row="4" Grid.Column="0" VerticalAlignment="Center">Drive Letter</Label>
|
||||
<Label Grid.Row="5" Grid.Column="0" VerticalAlignment="Center">Drive Speed</Label>
|
||||
<ComboBox x:Name="cmb_DiscType" Grid.Row="0" Grid.Column="1" Height="22" SelectionChanged="cmb_DiscType_SelectionChanged" />
|
||||
|
||||
<ComboBox x:Name="cmb_DiscType" Grid.Row="0" Grid.Column="1" Height="22" Text="Bandai Playdia Quick Interactive System" DropDownClosed="cmb_DiscType_DropDownClosed" SelectionChanged="cmb_DiscType_SelectionChanged">
|
||||
<ComboBoxItem Content="Unknown"/>
|
||||
<ComboBoxItem Content="---------- Consoles ----------" IsEnabled="False"/>
|
||||
<ComboBoxItem Content="Bandai Playdia Quick Interactive System"/>
|
||||
<ComboBoxItem Content="Bandai / Apple Pippin"/>
|
||||
<ComboBoxItem Content="Commodore Amiga CD / CD32 / CDTV"/>
|
||||
<ComboBoxItem Content="Mattel HyperScan"/>
|
||||
<ComboBoxItem Content="Microsoft XBOX One"/>
|
||||
<ComboBoxItem Content="NEC PC-Engine / TurboGrafx CD"/>
|
||||
<ComboBoxItem Content="NEC PC-FX / PC-FXGA"/>
|
||||
<ComboBoxItem Content="Panasonic 3DO"/>
|
||||
<ComboBoxItem Content="Philips CD-i"/>
|
||||
<ComboBoxItem Content="Sega CD / Mega CD"/>
|
||||
<ComboBoxItem Content="Sega Saturn"/>
|
||||
<ComboBoxItem Content="SNK Neo Geo CD"/>
|
||||
<ComboBoxItem Content="Sony PlayStation"/>
|
||||
<ComboBoxItem Content="Sony PlayStation 2 (CD-Rom)"/>
|
||||
<ComboBoxItem Content="Sony PlayStation 2 (DVD-Rom)"/>
|
||||
<ComboBoxItem Content="Sony PlayStation 4"/>
|
||||
<ComboBoxItem Content="VTech V.Flash - V.Smile Pro"/>
|
||||
<ComboBoxItem Content="---------- Computers ----------" IsEnabled="False"/>
|
||||
<ComboBoxItem Content="Apple Macintosh (CD-Rom)"/>
|
||||
<ComboBoxItem Content="Apple Macintosh (DVD-Rom)"/>
|
||||
<ComboBoxItem Content="Fujitsu FM Towns series"/>
|
||||
<ComboBoxItem Content="IBM PC Compatible (CD-Rom)"/>
|
||||
<ComboBoxItem Content="IBM PC Compatible (DVD-Rom)"/>
|
||||
<ComboBoxItem Content="NEC PC-88"/>
|
||||
<ComboBoxItem Content="NEC PC-98"/>
|
||||
<ComboBoxItem Content="---------- Arcade ----------" IsEnabled="False"/>
|
||||
<ComboBoxItem Content="Sega Lindbergh"/>
|
||||
<ComboBoxItem Content="---------- Others ----------" IsEnabled="False"/>
|
||||
<ComboBoxItem Content="Audio CD"/>
|
||||
<ComboBoxItem Content="BD-Video"/>
|
||||
<ComboBoxItem Content="DVD-Video"/>
|
||||
<ComboBoxItem Content="PalmOS"/>
|
||||
<ComboBoxItem Content="Photo CD"/>
|
||||
<ComboBoxItem Content="PlayStation GameShark Updates"/>
|
||||
<ComboBoxItem Content="Tomy Kiss-Site"/>
|
||||
<ComboBoxItem Content="Video CD"/>
|
||||
</ComboBox>
|
||||
<Label Grid.Row="1" Grid.Column="0" VerticalAlignment="Center">Output Filename</Label>
|
||||
<TextBox x:Name="txt_OutputFilename" Grid.Row="1" Grid.Column="1" Height="22"></TextBox>
|
||||
|
||||
<TextBox x:Name="TXT_DiscImageCreatorPath" Grid.Row="1" Grid.Column="1" Height="22" Width="345" HorizontalAlignment="left" IsEnabled="False" ></TextBox>
|
||||
<Button x:Name="BTN_DiscImageCreatorBrowse" Grid.Row="1" Grid.Column="1" Height="22" Width="50" HorizontalAlignment="Right" Content="Browse" IsEnabled="False"></Button>
|
||||
<Label Grid.Row="2" Grid.Column="0" VerticalAlignment="Center">Output Directory</Label>
|
||||
<TextBox x:Name="txt_OutputDirectory" Grid.Row="2" Grid.Column="1" Height="22" Width="345" HorizontalAlignment="left" Text="ISO" />
|
||||
<Button x:Name="btn_OutputDirectoryBrowse" Grid.Row="2" Grid.Column="1" Height="22" Width="50" HorizontalAlignment="Right" Content="Browse" Click="btn_OutputDirectoryBrowse_Click"/>
|
||||
|
||||
<TextBox x:Name="txt_OutputFilename" Grid.Row="2" Grid.Column="1" Height="22"></TextBox>
|
||||
<Label Grid.Row="3" Grid.Column="0" VerticalAlignment="Center">Drive Letter</Label>
|
||||
<ComboBox x:Name="cmb_DriveLetter" Grid.Row="3" Grid.Column="1" Height="22" Width="397" HorizontalAlignment="left" SelectionChanged="cmb_DriveLetter_SelectionChanged"/>
|
||||
|
||||
<TextBox x:Name="txt_OutputDirectory" Grid.Row="3" Grid.Column="1" Height="22" Width="345" HorizontalAlignment="left" Text="ISO" ></TextBox>
|
||||
<Button x:Name="BTN_OutputDirectoryBrowse" Grid.Row="3" Grid.Column="1" Height="22" Width="50" HorizontalAlignment="Right" Content="Browse" Click="BTN_OutputDirectoryBrowse_Click" ></Button>
|
||||
<Label Grid.Row="4" Grid.Column="0" VerticalAlignment="Center">Drive Speed</Label>
|
||||
<ComboBox x:Name="cmb_DriveSpeed" Grid.Row="4" Grid.Column="1" Height="22" Width="60" HorizontalAlignment="left" SelectionChanged="cmb_DriveSpeed_SelectionChanged"/>
|
||||
|
||||
<ComboBox x:Name="cmb_DriveLetter" Grid.Row="4" Grid.Column="1" Height="22" Width="60" HorizontalAlignment="left"></ComboBox>
|
||||
|
||||
<ComboBox x:Name="cmb_DriveSpeed" Grid.Row="5" Grid.Column="1" Height="22" Width="60" HorizontalAlignment="left" SelectionChanged="cmb_DriveSpeed_SelectionChanged">
|
||||
<ComboBoxItem Content="4"/>
|
||||
<ComboBoxItem Content="8"/>
|
||||
<ComboBoxItem Content="16"/>
|
||||
<ComboBoxItem Content="48"/>
|
||||
<ComboBoxItem Content="Custom"/>
|
||||
</ComboBox>
|
||||
<Label Grid.Row="5" Grid.Column="0" VerticalAlignment="Center">Custom Parameters</Label>
|
||||
<TextBox x:Name="txt_CustomParameters" Grid.Row="5" Grid.Column="1" Height="22" Width="397" HorizontalAlignment="left" IsEnabled="False" />
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="1" Grid.Column="0" Margin="15,19.6,15.2,9.8" Grid.ColumnSpan="2">
|
||||
@@ -112,7 +65,7 @@
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Button x:Name="btn_Start" Grid.Row="0" Grid.Column="0" Height="22" Width="150" VerticalAlignment="Center" HorizontalAlignment="Center" Content="Start Dumping" Click="btn_Start_Click" IsEnabled="False" />
|
||||
<Button x:Name="btn_StartStop" Grid.Row="0" Grid.Column="0" Height="22" Width="150" VerticalAlignment="Center" HorizontalAlignment="Center" Content="Start Dumping" Click="btn_StartStop_Click" IsEnabled="False" />
|
||||
<Button x:Name="btn_Search" Grid.Row="0" Grid.Column="1" Height="22" Width="150" VerticalAlignment="Center" HorizontalAlignment="Center" Content="Scan for disks" Click="btn_Search_Click" />
|
||||
</Grid>
|
||||
|
||||
@@ -125,9 +78,6 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label x:Name="lbl_Status" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center" Content="Waiting for CD or DVD..." />
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Window>
|
||||
|
||||
@@ -1,411 +1,454 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.IO;
|
||||
using WinForms = System.Windows.Forms;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using WinForms = System.Windows.Forms;
|
||||
|
||||
namespace DICUI
|
||||
{
|
||||
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public String discType;
|
||||
public String processArguments;
|
||||
public String dicPath = "Programs\\DiscImageCreator.exe";
|
||||
public String driveLetter;
|
||||
public String outputDirectory;
|
||||
public String outputFileName;
|
||||
public String driveSpeed;
|
||||
public Boolean isPSX = false;
|
||||
public Boolean isXboneOrPS4 = false;
|
||||
// TODO: Make configurable in UI or in Settings
|
||||
private const string defaultOutputPath = "ISO";
|
||||
private const string dicPath = "Programs\\DiscImageCreator.exe";
|
||||
private const string psxtPath = "psxt001z.exe";
|
||||
private const string sgRawPath = "sg_raw.exe";
|
||||
|
||||
public void ScanForDisk()
|
||||
private List<Tuple<char, string>> _drives { get; set; }
|
||||
private List<int> _driveSpeeds { get { return new List<int> { 1, 2, 3, 4, 6, 8, 12, 16, 20, 24, 32, 40, 44, 48, 52, 56, 72 }; } }
|
||||
private List<Tuple<string, KnownSystem?, DiscType?>> _systems { get; set; }
|
||||
private Process childProcess { get; set; }
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
btn_Search.IsEnabled = false;
|
||||
cmb_DriveLetter.Items.Clear();
|
||||
foreach (var d in DriveInfo.GetDrives().Where(d => d.DriveType == DriveType.CDRom))
|
||||
InitializeComponent();
|
||||
|
||||
// Populate the list of systems
|
||||
PopulateSystems();
|
||||
|
||||
// Populate the list of drives
|
||||
PopulateDrives();
|
||||
|
||||
// Populate the list of drive speeds
|
||||
PopulateDriveSpeeds();
|
||||
SetSupportedDriveSpeed();
|
||||
}
|
||||
|
||||
#region Events
|
||||
|
||||
private void btn_StartStop_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if ((string)btn_StartStop.Content == UIElements.StartDumping)
|
||||
{
|
||||
if (d.IsReady == true)
|
||||
{
|
||||
txt_OutputFilename.Text = d.VolumeLabel;
|
||||
|
||||
if (txt_OutputFilename.Text == "")
|
||||
{
|
||||
txt_OutputFilename.Text = "unknown";
|
||||
}
|
||||
cmb_DriveLetter.Items.Add(d.Name.Replace(":\\", ""));
|
||||
cmb_DriveLetter.SelectedIndex = 0;
|
||||
txt_OutputDirectory.Text = "ISO" + "\\" + txt_OutputFilename.Text + "\\";
|
||||
lbl_Status.Content = "CD or DVD found ! Choose your Disc Type";
|
||||
btn_Start.IsEnabled = true;
|
||||
cmb_DriveSpeed.Text = "8";
|
||||
}
|
||||
else
|
||||
{
|
||||
lbl_Status.Content = "No CD or DVD found !";
|
||||
}
|
||||
btn_Search.IsEnabled = true;
|
||||
StartDumping();
|
||||
}
|
||||
else if ((string)btn_StartStop.Content == UIElements.StopDumping)
|
||||
{
|
||||
CancelDumping();
|
||||
}
|
||||
}
|
||||
|
||||
public void BrowseFolder()
|
||||
private void btn_OutputDirectoryBrowse_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
BrowseFolder();
|
||||
EnsureDiscInformation();
|
||||
}
|
||||
|
||||
private void btn_Search_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
PopulateDrives();
|
||||
SetSupportedDriveSpeed();
|
||||
EnsureDiscInformation();
|
||||
}
|
||||
|
||||
private void cmb_DiscType_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
EnsureDiscInformation();
|
||||
GetOutputNames();
|
||||
}
|
||||
|
||||
private void cmb_DriveLetter_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
SetSupportedDriveSpeed();
|
||||
GetOutputNames();
|
||||
EnsureDiscInformation();
|
||||
}
|
||||
|
||||
private void cmb_DriveSpeed_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
EnsureDiscInformation();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Helpers
|
||||
|
||||
/// <summary>
|
||||
/// Get a complete list of supported systems and fill the combo box
|
||||
/// </summary>
|
||||
private void PopulateSystems()
|
||||
{
|
||||
_systems = Utilities.CreateListOfSystems();
|
||||
cmb_DiscType.ItemsSource = _systems;
|
||||
cmb_DiscType.DisplayMemberPath = "Item1";
|
||||
cmb_DiscType.SelectedIndex = 0;
|
||||
cmb_DiscType_SelectionChanged(null, null);
|
||||
|
||||
btn_StartStop.IsEnabled = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a complete list of active disc drives and fill the combo box
|
||||
/// </summary>
|
||||
/// <remarks>TODO: Find a way for this to periodically run, or have it hook to a "drive change" event</remarks>
|
||||
private void PopulateDrives()
|
||||
{
|
||||
// Populate the list of drives and add it to the combo box
|
||||
_drives = Utilities.CreateListOfDrives();
|
||||
cmb_DriveLetter.ItemsSource = _drives;
|
||||
cmb_DriveLetter.DisplayMemberPath = "Item1";
|
||||
cmb_DriveLetter.SelectedIndex = 0;
|
||||
cmb_DriveLetter_SelectionChanged(null, null);
|
||||
|
||||
if (cmb_DriveLetter.Items.Count > 0)
|
||||
{
|
||||
lbl_Status.Content = "Valid optical disc found! Choose your Disc Type";
|
||||
btn_StartStop.IsEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
lbl_Status.Content = "No valid optical disc found!";
|
||||
btn_StartStop.IsEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a complete list of (possible) disc drive speeds, and fill the combo box
|
||||
/// </summary>
|
||||
private void PopulateDriveSpeeds()
|
||||
{
|
||||
cmb_DriveSpeed.ItemsSource = _driveSpeeds;
|
||||
cmb_DriveSpeed.SelectedItem = 8;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Browse for an output folder
|
||||
/// </summary>
|
||||
private void BrowseFolder()
|
||||
{
|
||||
WinForms.FolderBrowserDialog folderDialog = new WinForms.FolderBrowserDialog { ShowNewFolderButton = false, SelectedPath = System.AppDomain.CurrentDomain.BaseDirectory };
|
||||
WinForms.DialogResult result = folderDialog.ShowDialog();
|
||||
|
||||
if (result == WinForms.DialogResult.OK)
|
||||
{
|
||||
String sPath = folderDialog.SelectedPath;
|
||||
txt_OutputDirectory.Text = sPath;
|
||||
txt_OutputDirectory.Text = folderDialog.SelectedPath;
|
||||
}
|
||||
}
|
||||
|
||||
public async void StartDumping()
|
||||
/// <summary>
|
||||
/// Begin the dumping process using the given inputs
|
||||
/// </summary>
|
||||
private async void StartDumping()
|
||||
{
|
||||
// Local variables
|
||||
string driveLetter = cmb_DriveLetter.Text;
|
||||
string outputDirectory = txt_OutputDirectory.Text;
|
||||
string outputFilename = txt_OutputFilename.Text;
|
||||
btn_StartStop.Content = UIElements.StopDumping;
|
||||
|
||||
driveLetter = cmb_DriveLetter.Text;
|
||||
outputDirectory = txt_OutputDirectory.Text;
|
||||
outputFileName = txt_OutputFilename.Text;
|
||||
driveSpeed = cmb_DriveSpeed.Text;
|
||||
btn_Start.IsEnabled = false;
|
||||
// Get the currently selected item
|
||||
var selected = cmb_DiscType.SelectedValue as Tuple<string, KnownSystem?, DiscType?>;
|
||||
|
||||
switch (Convert.ToString(cmb_DiscType.Text))
|
||||
// Validate that everything is good
|
||||
if (string.IsNullOrWhiteSpace(txt_CustomParameters.Text)
|
||||
|| !Utilities.ValidateParameters(txt_CustomParameters.Text))
|
||||
{
|
||||
#region Consoles
|
||||
|
||||
case "Bandai Playdia Quick Interactive System":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "Bandai / Apple Pippin":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "Commodore Amiga CD / CD32 / CDTV":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "Mattel HyperScan":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "Microsoft XBOX":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
case "Microsoft XBOX 360":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
case "Microsoft XBOX One":
|
||||
discType = "bd";
|
||||
processArguments = "";
|
||||
isXboneOrPS4 = true;
|
||||
break;
|
||||
case "NEC PC-Engine / TurboGrafx CD":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "NEC PC-FX / PC-FXGA":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "Nintendo GameCube":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
case "Nintendo Wii":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
case "Nintendo Wii U":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
case "Panasonic 3DO":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "Philips CD-i":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "Sega CD / Mega CD":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "Sega Dreamcast":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
case "Sega Saturn":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "SNK Neo Geo CD":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "Sony PlayStation":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
isPSX = true;
|
||||
break;
|
||||
case "Sony PlayStation 2 (CD-Rom)":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "Sony PlayStation 2 (DVD-Rom)":
|
||||
discType = "dvd";
|
||||
processArguments = "";
|
||||
break;
|
||||
case "Sony PlayStation 3":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
case "Sony PlayStation 4":
|
||||
discType = "bd";
|
||||
processArguments = "";
|
||||
isXboneOrPS4 = true;
|
||||
break;
|
||||
case "Sony PlayStation Portable":
|
||||
// No-op - PSP can't be dumped with DIC
|
||||
break;
|
||||
case "VM Labs NUON":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
case "VTech V.Flash - V.Smile Pro":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "ZAPiT Games Game Wave Family Entertainment System":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Computers
|
||||
|
||||
case "Acorn Archimedes":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
case "Apple Macintosh (CD-Rom)":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "Apple Macintosh (DVD-Rom)":
|
||||
discType = "dvd";
|
||||
processArguments = "";
|
||||
break;
|
||||
case "Fujitsu FM Towns series":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "IBM PC Compatible (CD-Rom)":
|
||||
discType = "cd";
|
||||
processArguments = "/c2 /ns /sf /ss";
|
||||
break;
|
||||
case "IBM PC Compatible (DVD-Rom)":
|
||||
discType = "dvd";
|
||||
processArguments = "";
|
||||
break;
|
||||
case "NEC PC-88":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "NEC PC-98":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "Sharp X68000":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Arcade
|
||||
|
||||
case "Namco / Sega / Nintendo Triforce":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
case "Sega Chihiro":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
case "Sega Lindbergh":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "Sega Naomi":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
case "Sega Naomi 2":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
case "TAB-Austria Quizard":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
|
||||
case "Tandy / Memorex Visual Information System":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Others
|
||||
|
||||
case "Audio CD":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "BD-Video":
|
||||
discType = "bd";
|
||||
processArguments = "";
|
||||
break;
|
||||
case "DVD-Video":
|
||||
discType = "dvd";
|
||||
break;
|
||||
case "PalmOS":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "Philips CD-i Digital Video":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
case "Photo CD":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "PlayStation GameShark Updates":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "Tao iKTV":
|
||||
// Placeholder for later use
|
||||
break;
|
||||
case "Tomy Kiss-Site":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
case "Video CD":
|
||||
discType = "cd";
|
||||
processArguments = "/c2";
|
||||
break;
|
||||
|
||||
#endregion
|
||||
|
||||
case "Unknown":
|
||||
default:
|
||||
discType = "";
|
||||
processArguments = "";
|
||||
break;
|
||||
lbl_Status.Content = "Error! Current configuration is not supported!";
|
||||
btn_StartStop.Content = UIElements.StartDumping;
|
||||
return;
|
||||
}
|
||||
|
||||
// Validate that the required program exits
|
||||
if (!File.Exists(dicPath))
|
||||
{
|
||||
lbl_Status.Content = "Error! Could not find DiscImageCreator!";
|
||||
btn_StartStop.Content = UIElements.StartDumping;
|
||||
return;
|
||||
}
|
||||
|
||||
// If a complete dump already exists
|
||||
if (Utilities.FoundAllFiles(outputDirectory, outputFilename, selected.Item3))
|
||||
{
|
||||
MessageBoxResult result = MessageBox.Show("A complete dump already exists! Are you sure you want to overwrite?", "Overwrite?", MessageBoxButton.YesNo, MessageBoxImage.Exclamation);
|
||||
if (result == MessageBoxResult.No || result == MessageBoxResult.Cancel || result == MessageBoxResult.None)
|
||||
{
|
||||
lbl_Status.Content = "Dumping aborted!";
|
||||
btn_StartStop.Content = UIElements.StartDumping;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
lbl_Status.Content = "Beginning dumping process";
|
||||
string parameters = txt_CustomParameters.Text;
|
||||
|
||||
await Task.Run(
|
||||
() =>
|
||||
{
|
||||
Process process = new Process();
|
||||
process.StartInfo.FileName = dicPath; // TODO: Make this configurable in UI
|
||||
process.StartInfo.Arguments = discType + " " + driveLetter + " \"" + outputDirectory + "\\" + outputFileName + "\" " + driveSpeed + " " + processArguments;
|
||||
Console.WriteLine(process.StartInfo.Arguments);
|
||||
process.Start();
|
||||
process.WaitForExit();
|
||||
childProcess = new Process()
|
||||
{
|
||||
StartInfo = new ProcessStartInfo()
|
||||
{
|
||||
FileName = dicPath,
|
||||
Arguments = parameters,
|
||||
},
|
||||
};
|
||||
childProcess.Start();
|
||||
childProcess.WaitForExit();
|
||||
});
|
||||
|
||||
if (isXboneOrPS4 == true)
|
||||
// Special cases
|
||||
switch (selected.Item2)
|
||||
{
|
||||
// TODO: Add random string / GUID to end of batch file name so that multiple instances can run at once
|
||||
using (StreamWriter writetext = new StreamWriter("XboneOrPS4.bat"))
|
||||
{
|
||||
writetext.WriteLine("sg_raw.exe -v -r 4100 -R " + driveLetter + ": " + "ad 01 00 00 00 00 00 00 10 04 00 00 -o \"PIC.bin\"");
|
||||
}
|
||||
Process processXboneOrPS4 = new Process();
|
||||
processXboneOrPS4.StartInfo.FileName = "XboneOrPS4.bat";
|
||||
processXboneOrPS4.Start();
|
||||
processXboneOrPS4.WaitForExit();
|
||||
}
|
||||
if (isPSX == true)
|
||||
{
|
||||
// TODO: Add random string / GUID to end of batch file name so that multiple instances can run at once
|
||||
using (StreamWriter writetext = new StreamWriter("PSX.bat"))
|
||||
{
|
||||
writetext.WriteLine("edccchk" + " " + "\"" + outputDirectory + "\\" + outputFileName + ".bin" + "\" > " + "\"" + outputDirectory + "\\" + "edccchk1.txt");
|
||||
writetext.WriteLine("edccchk" + " " + "\"" + outputDirectory + "\\" + outputFileName + " (Track 1).bin" + "\" > " + "\"" + outputDirectory + "\\" + "edccchk1.txt");
|
||||
writetext.WriteLine("edccchk" + " " + "\"" + outputDirectory + "\\" + outputFileName + " (Track 01).bin" + "\" > " + "\"" + outputDirectory + "\\" + "edccchk1.txt");
|
||||
writetext.WriteLine("psxt001z" + " " + "\"" + outputDirectory + "\\" + outputFileName + ".bin" + "\" > " + "\"" + outputDirectory + "\\" + "psxt001z1.txt");
|
||||
writetext.WriteLine("psxt001z" + " " + "\"" + outputDirectory + "\\" + outputFileName + " (Track 1).bin" + "\" > " + "\"" + outputDirectory + "\\" + "psxt001z2.txt");
|
||||
writetext.WriteLine("psxt001z" + " " + "\"" + outputDirectory + "\\" + outputFileName + " (Track 01).bin" + "\" > " + "\"" + outputDirectory + "\\" + "psxt001z3.txt");
|
||||
writetext.WriteLine("psxt001z" + " " + "--libcrypt " + "\"" + outputDirectory + "\\" + outputFileName + ".sub\" > " + "\"" + outputDirectory + "\\" + "libcrypt.txt");
|
||||
writetext.WriteLine("psxt001z" + " " + "--libcryptdrvfast " + driveLetter + " > " + "\"" + outputDirectory + "\\" + "libcryptdrv.log");
|
||||
}
|
||||
Process processpsx = new Process();
|
||||
processpsx.StartInfo.FileName = "PSX.bat";
|
||||
processpsx.Start();
|
||||
processpsx.WaitForExit();
|
||||
}
|
||||
btn_Start.IsEnabled = true;
|
||||
}
|
||||
case KnownSystem.MicrosoftXBOXOne:
|
||||
case KnownSystem.SonyPlayStation4:
|
||||
if (!File.Exists(sgRawPath))
|
||||
{
|
||||
lbl_Status.Content = "Error! Could not find sg-raw!";
|
||||
break;
|
||||
}
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
ScanForDisk();
|
||||
}
|
||||
|
||||
private void btn_Start_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
StartDumping();
|
||||
}
|
||||
|
||||
private void BTN_OutputDirectoryBrowse_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
BrowseFolder();
|
||||
}
|
||||
|
||||
private void btn_Search_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ScanForDisk();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void cmb_DiscType_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
||||
{
|
||||
|
||||
|
||||
lbl_Status.Content = "Ready to dump";
|
||||
}
|
||||
|
||||
private void cmb_DriveSpeed_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
||||
{
|
||||
// TODO: Figure out how to keep the list of items while also allowing the custom input
|
||||
if (cmb_DriveSpeed.SelectedIndex == 4)
|
||||
{
|
||||
cmb_DriveSpeed.Items.Clear();
|
||||
cmb_DriveSpeed.IsEditable = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void cmb_DiscType_DropDownClosed(object sender, EventArgs e)
|
||||
{
|
||||
switch (Convert.ToString(cmb_DiscType.Text))
|
||||
{
|
||||
|
||||
case "Sony PlayStation 4":
|
||||
cmb_DriveSpeed.Items.Clear();
|
||||
cmb_DriveSpeed.IsEnabled = false;
|
||||
childProcess = new Process()
|
||||
{
|
||||
StartInfo = new ProcessStartInfo()
|
||||
{
|
||||
FileName = sgRawPath,
|
||||
Arguments = "-v -r 4100 -R " + driveLetter + ": " + "ad 01 00 00 00 00 00 00 10 04 00 00 -o \"PIC.bin\""
|
||||
},
|
||||
};
|
||||
childProcess.Start();
|
||||
childProcess.WaitForExit();
|
||||
break;
|
||||
case "Microsoft XBOX One":
|
||||
cmb_DriveSpeed.Items.Clear();
|
||||
case KnownSystem.SonyPlayStation:
|
||||
if (!File.Exists(psxtPath))
|
||||
{
|
||||
lbl_Status.Content = "Error! Could not find psxt001z!";
|
||||
break;
|
||||
}
|
||||
|
||||
// Invoke the program with all 3 configurations
|
||||
// TODO: Use these outputs for PSX information
|
||||
childProcess = new Process()
|
||||
{
|
||||
StartInfo = new ProcessStartInfo()
|
||||
{
|
||||
FileName = psxtPath,
|
||||
Arguments = "\"" + Utilities.GetFirstTrack(outputDirectory, outputFilename) + "\" > " + "\"" + Path.Combine(outputDirectory, "psxt001z.txt"),
|
||||
},
|
||||
};
|
||||
childProcess.Start();
|
||||
childProcess.WaitForExit();
|
||||
|
||||
childProcess = new Process()
|
||||
{
|
||||
StartInfo = new ProcessStartInfo()
|
||||
{
|
||||
FileName = psxtPath,
|
||||
Arguments = "--libcrypt " + "\"" + Path.Combine(outputDirectory, outputFilename + ".sub") + "\" > " + "\"" + Path.Combine(outputDirectory, "libcrypt.txt"),
|
||||
},
|
||||
};
|
||||
childProcess.Start();
|
||||
childProcess.WaitForExit();
|
||||
|
||||
childProcess = new Process()
|
||||
{
|
||||
StartInfo = new ProcessStartInfo()
|
||||
{
|
||||
FileName = psxtPath,
|
||||
Arguments = "--libcryptdrvfast " + driveLetter + " > " + "\"" + Path.Combine(outputDirectory, "libcryptdrv.log"),
|
||||
},
|
||||
};
|
||||
childProcess.Start();
|
||||
childProcess.WaitForExit();
|
||||
break;
|
||||
}
|
||||
|
||||
// Check to make sure that the output had all the correct files
|
||||
if (!Utilities.FoundAllFiles(outputDirectory, outputFilename, selected.Item3))
|
||||
{
|
||||
lbl_Status.Content = "Error! Please check output directory as dump may be incomplete!";
|
||||
btn_StartStop.Content = UIElements.StartDumping;
|
||||
return;
|
||||
}
|
||||
|
||||
lbl_Status.Content = "Dumping complete!";
|
||||
|
||||
Dictionary<string, string> templateValues = Utilities.ExtractOutputInformation(outputDirectory, outputFilename, selected.Item2, selected.Item3);
|
||||
List<string> formattedValues = Utilities.FormatOutputData(templateValues, selected.Item2, selected.Item3);
|
||||
bool success = Utilities.WriteOutputData(outputDirectory, outputFilename, formattedValues);
|
||||
|
||||
btn_StartStop.Content = UIElements.StartDumping;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cancel an in-progress dumping process
|
||||
/// </summary>
|
||||
private void CancelDumping()
|
||||
{
|
||||
try
|
||||
{
|
||||
childProcess.Kill();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ensure information is consistent with the currently selected disc type
|
||||
/// </summary>
|
||||
private void EnsureDiscInformation()
|
||||
{
|
||||
// If we're on a separator, go to the next item
|
||||
var tuple = cmb_DiscType.SelectedItem as Tuple<string, KnownSystem?, DiscType?>;
|
||||
if (tuple.Item2 == null && tuple.Item3 == null)
|
||||
{
|
||||
cmb_DiscType.SelectedIndex++;
|
||||
tuple = cmb_DiscType.SelectedItem as Tuple<string, KnownSystem?, DiscType?>;
|
||||
}
|
||||
|
||||
// If we're on an unsupported type, update the status accordingly
|
||||
switch (tuple.Item3)
|
||||
{
|
||||
case DiscType.NONE:
|
||||
lbl_Status.Content = "Please select a valid disc type";
|
||||
btn_StartStop.IsEnabled = false;
|
||||
break;
|
||||
case DiscType.GameCubeGameDisc:
|
||||
case DiscType.GDROM:
|
||||
lbl_Status.Content = string.Format("{0} discs are partially supported by DIC", Utilities.DiscTypeToString(tuple.Item3));
|
||||
btn_StartStop.IsEnabled = true;
|
||||
break;
|
||||
case DiscType.HDDVD:
|
||||
case DiscType.UMD:
|
||||
lbl_Status.Content = string.Format("{0} discs are not currently supported by DIC", Utilities.DiscTypeToString(tuple.Item3));
|
||||
btn_StartStop.IsEnabled = true;
|
||||
break;
|
||||
default:
|
||||
lbl_Status.Content = string.Format("{0} ready to dump", Utilities.DiscTypeToString(tuple.Item3));
|
||||
btn_StartStop.IsEnabled = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// If we're in a type that doesn't support drive speeds
|
||||
switch (tuple.Item3)
|
||||
{
|
||||
case DiscType.BD25:
|
||||
case DiscType.BD50:
|
||||
cmb_DriveSpeed.IsEnabled = false;
|
||||
break;
|
||||
default:
|
||||
cmb_DriveSpeed.IsEnabled = true;
|
||||
cmb_DriveSpeed.Items.Clear();
|
||||
cmb_DriveSpeed.Items.Add("4");
|
||||
cmb_DriveSpeed.Items.Add("8");
|
||||
cmb_DriveSpeed.Items.Add("16");
|
||||
cmb_DriveSpeed.Items.Add("48");
|
||||
cmb_DriveSpeed.Items.Add("Custom");
|
||||
cmb_DriveSpeed.SelectedIndex = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
// Special case for Custom input
|
||||
if (tuple.Item1 == "Custom Input" && tuple.Item2 == KnownSystem.NONE && tuple.Item3 == DiscType.NONE)
|
||||
{
|
||||
txt_CustomParameters.IsEnabled = true;
|
||||
txt_OutputFilename.IsEnabled = false;
|
||||
txt_OutputDirectory.IsEnabled = false;
|
||||
btn_OutputDirectoryBrowse.IsEnabled = false;
|
||||
cmb_DriveLetter.IsEnabled = false;
|
||||
cmb_DriveSpeed.IsEnabled = false;
|
||||
lbl_Status.Content = "User input mode";
|
||||
}
|
||||
else
|
||||
{
|
||||
txt_CustomParameters.IsEnabled = false;
|
||||
txt_OutputFilename.IsEnabled = true;
|
||||
txt_OutputDirectory.IsEnabled = true;
|
||||
btn_OutputDirectoryBrowse.IsEnabled = true;
|
||||
cmb_DriveLetter.IsEnabled = true;
|
||||
cmb_DriveSpeed.IsEnabled = true;
|
||||
|
||||
// Populate with the correct params for inputs (if we're not on the default option)
|
||||
if (cmb_DiscType.SelectedIndex > 0)
|
||||
{
|
||||
var selected = cmb_DiscType.SelectedValue as Tuple<string, KnownSystem?, DiscType?>;
|
||||
string discType = Utilities.GetBaseCommand(selected.Item3);
|
||||
List<string> defaultParams = Utilities.GetDefaultParameters(selected.Item2, selected.Item3);
|
||||
txt_CustomParameters.Text = discType
|
||||
+ " " + cmb_DriveLetter.Text
|
||||
+ " \"" + Path.Combine(txt_OutputDirectory.Text, txt_OutputFilename.Text + Utilities.GetDefaultExtension(selected.Item3)) + "\" "
|
||||
+ (selected.Item3 != DiscType.BD25 && selected.Item3 != DiscType.BD50 ? (int)cmb_DriveSpeed.SelectedItem + " " : "")
|
||||
+ string.Join(" ", defaultParams);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the default output directory name from the currently selected drive
|
||||
/// </summary>
|
||||
private void GetOutputNames()
|
||||
{
|
||||
var driveTuple = cmb_DriveLetter.SelectedItem as Tuple<char, string>;
|
||||
var discTuple = cmb_DiscType.SelectedItem as Tuple<string, KnownSystem?, DiscType?>;
|
||||
|
||||
if (driveTuple != null && discTuple != null)
|
||||
{
|
||||
txt_OutputDirectory.Text = Path.Combine(defaultOutputPath, driveTuple.Item2);
|
||||
txt_OutputFilename.Text = driveTuple.Item2 + Utilities.GetDefaultExtension(discTuple.Item3);
|
||||
}
|
||||
else
|
||||
{
|
||||
txt_OutputDirectory.Text = defaultOutputPath;
|
||||
txt_OutputFilename.Text = "disc.bin";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the highest supported drive speed as reported by DiscImageCreator
|
||||
/// </summary>
|
||||
private void SetSupportedDriveSpeed()
|
||||
{
|
||||
// Get the drive letter from the selected item
|
||||
var selected = cmb_DriveLetter.SelectedItem as Tuple<char, string>;
|
||||
char driveLetter = selected.Item1;
|
||||
|
||||
// Validate that the required program exits
|
||||
if (!File.Exists(dicPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
childProcess = new Process()
|
||||
{
|
||||
StartInfo = new ProcessStartInfo()
|
||||
{
|
||||
FileName = dicPath,
|
||||
Arguments = DICCommands.DriveSpeedCommand + " " + driveLetter,
|
||||
CreateNoWindow = true,
|
||||
UseShellExecute = false,
|
||||
RedirectStandardOutput = true,
|
||||
},
|
||||
};
|
||||
childProcess.Start();
|
||||
childProcess.WaitForExit();
|
||||
string output = childProcess.StandardOutput.ReadToEnd();
|
||||
|
||||
int index = output.IndexOf("ReadSpeedMaximum:");
|
||||
string readspeed = Regex.Match(output.Substring(index), @"ReadSpeedMaximum: [0-9]+KB/sec \(([0-9]*)x\)").Groups[1].Value;
|
||||
if (!Int32.TryParse(readspeed, out int speed))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
cmb_DriveSpeed.SelectedValue = speed;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
46
README.md
46
README.md
@@ -1,6 +1,11 @@
|
||||
# DICUI
|
||||
This is my current progress on my C# Disc Image Creator UI.
|
||||
|
||||
I am using Disc Image Creator, created by Sarami, and would like to thanks him for this great software.
|
||||
|
||||
You can get the latest code and released on his github right here:
|
||||
https://github.com/saramibreak/DiscImageCreator
|
||||
|
||||
I'm a hobbyist programmer, so this code might not be optimal, feel free to make your recommendation / Pull request.
|
||||
|
||||
I would like this project to be a community project, so if you have some time and knowledge to give, I'll be glad to add you to the contributor of this project :)
|
||||
@@ -8,18 +13,55 @@ I would like this project to be a community project, so if you have some time an
|
||||
--------------------------------------------------------------------------
|
||||
Currently working on the project:
|
||||
|
||||
ReignStumble - Lead Developer
|
||||
ReignStumble - Co-Lead Programmer
|
||||
|
||||
darksabre76 - Contributer
|
||||
darksabre76 - Co-Lead Programmer
|
||||
|
||||
NHellFire - Contributer
|
||||
|
||||
Dizzzy - Concept/Ideas/Beta tester
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
2018-06-13
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
Version 1.04 released:
|
||||
|
||||
- Behind-the-scenes fixes and formatting
|
||||
- Better checks for external programs
|
||||
- Automatically changing disc information
|
||||
- Custom parameters (and parameter validation)
|
||||
- Automatic drive speed selection
|
||||
- Automatic submission information creation
|
||||
- Add ability to stop a dump from the UI
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
2018-06-08
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
Version 1.03 released:
|
||||
|
||||
- edccchk now run on all CD-Roms
|
||||
- Discs unsupported by Windows are now regonized
|
||||
- Extra \ when accepting default save has been removed.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
2018-05-18
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
Version 1.02b released:
|
||||
|
||||
- Fixed XBOX One and PS4 Drive Speed issue. (1.02)
|
||||
- Started implementing DiscImageCreator Path selection. (1.02)
|
||||
- Conforming my naming for objects and variable. (1.02)
|
||||
- Added missing DLL (1.02b)
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
2018-05-14
|
||||
--------------------------------------------------------------------------
|
||||
Version 1.01d released:
|
||||
|
||||
|
||||
Download the latest release here:
|
||||
https://github.com/reignstumble/DICUI/releases
|
||||
|
||||
1897
Utilities.cs
Normal file
1897
Utilities.cs
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user